From b1d725f898bfdd77ecb60f1e9c2a6efaa6ab8948 Mon Sep 17 00:00:00 2001 From: Abdulla Abdurakhmanov Date: Mon, 2 Dec 2024 20:08:52 +0100 Subject: [PATCH] feature/gcloud 0.26 (#196) * Ver up in README * Clippy warning fixes * chore: Google Cloud SDK v0.26 support --- Cargo.toml | 2 +- README.md | 2 +- examples/batch-get-stream.rs | 2 +- examples/camel-case.rs | 2 +- examples/consistency-selector.rs | 2 +- examples/document-transform.rs | 2 +- examples/group-query.rs | 4 ++-- examples/list-docs.rs | 2 +- examples/nested_collections.rs | 4 ++-- examples/query-with-cursor.rs | 2 +- examples/read-write-transactions.rs | 2 +- examples/transactions.rs | 2 +- src/db/listen_changes.rs | 1 + src/lib.rs | 1 + tests/complex-structure-serialize.rs | 2 +- tests/crud-integration-tests.rs | 2 +- tests/nested-collections-tests.rs | 4 ++-- tests/query-integration-tests.rs | 4 ++-- 18 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5751237..32b2725 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ tls-webpki-roots = ["gcloud-sdk/tls-webpki-roots"] [dependencies] tracing = "0.1" -gcloud-sdk = { version = "0.25.6", default-features = false, features = ["google-firestore-v1"] } +gcloud-sdk = { version = "0.26.0", default-features = false, features = ["google-firestore-v1"] } hyper = { version = "1" } struct-path = "0.2" rvstruct = "0.3.2" diff --git a/README.md b/README.md index 92dcd5f..ceca468 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Cargo.toml: ```toml [dependencies] -firestore = "0.43" +firestore = "0.44" ``` ## Examples diff --git a/examples/batch-get-stream.rs b/examples/batch-get-stream.rs index d5c130d..ce7dcb5 100644 --- a/examples/batch-get-stream.rs +++ b/examples/batch-get-stream.rs @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/camel-case.rs b/examples/camel-case.rs index aece801..496bc74 100644 --- a/examples/camel-case.rs +++ b/examples/camel-case.rs @@ -56,7 +56,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/consistency-selector.rs b/examples/consistency-selector.rs index cdfa4d5..5190320 100644 --- a/examples/consistency-selector.rs +++ b/examples/consistency-selector.rs @@ -48,7 +48,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/document-transform.rs b/examples/document-transform.rs index b724a1d..e237827 100644 --- a/examples/document-transform.rs +++ b/examples/document-transform.rs @@ -52,7 +52,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/group-query.rs b/examples/group-query.rs index 8fb8237..a2c14a3 100644 --- a/examples/group-query.rs +++ b/examples/group-query.rs @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box> { .into(TEST_PARENT_COLLECTION_NAME) .document_id(&parent_struct.some_id) .object(&parent_struct) - .execute() + .execute::<()>() .await?; for child_idx in 0..3 { @@ -83,7 +83,7 @@ async fn main() -> Result<(), Box> { .document_id(&child_struct.some_id) .parent(&parent_path) .object(&child_struct) - .execute() + .execute::<()>() .await?; } } diff --git a/examples/list-docs.rs b/examples/list-docs.rs index e5b3eec..763bdc4 100644 --- a/examples/list-docs.rs +++ b/examples/list-docs.rs @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/nested_collections.rs b/examples/nested_collections.rs index e725f94..0655d71 100644 --- a/examples/nested_collections.rs +++ b/examples/nested_collections.rs @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box> { .into(TEST_PARENT_COLLECTION_NAME) .document_id(&parent_struct.some_id) .object(&parent_struct) - .execute() + .execute::<()>() .await?; // Creating a child doc @@ -82,7 +82,7 @@ async fn main() -> Result<(), Box> { .document_id(&child_struct.some_id) .parent(&parent_path) .object(&child_struct) - .execute() + .execute::<()>() .await?; println!("Listing all children"); diff --git a/examples/query-with-cursor.rs b/examples/query-with-cursor.rs index 3f58185..2c88eee 100644 --- a/examples/query-with-cursor.rs +++ b/examples/query-with-cursor.rs @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/examples/read-write-transactions.rs b/examples/read-write-transactions.rs index e496ac0..52e9698 100644 --- a/examples/read-write-transactions.rs +++ b/examples/read-write-transactions.rs @@ -52,7 +52,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(TEST_DOCUMENT_ID) .object(&my_struct) - .execute() + .execute::<()>() .await?; println!("Running transactions..."); diff --git a/examples/transactions.rs b/examples/transactions.rs index df5cab9..1478216 100644 --- a/examples/transactions.rs +++ b/examples/transactions.rs @@ -48,7 +48,7 @@ async fn main() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct.some_id) .object(&my_struct) - .execute() + .execute::<()>() .await?; } diff --git a/src/db/listen_changes.rs b/src/db/listen_changes.rs index b8566e5..510445f 100644 --- a/src/db/listen_changes.rs +++ b/src/db/listen_changes.rs @@ -42,6 +42,7 @@ pub struct FirestoreCollectionDocuments { pub documents: Vec, } +#[allow(clippy::large_enum_variant)] #[derive(Debug, Clone)] pub enum FirestoreTargetType { Query(FirestoreQueryParams), diff --git a/src/lib.rs b/src/lib.rs index 6587776..04b7437 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,6 +122,7 @@ //! #![allow(clippy::new_without_default)] +#![allow(clippy::needless_lifetimes)] #![forbid(unsafe_code)] pub mod errors; diff --git a/tests/complex-structure-serialize.rs b/tests/complex-structure-serialize.rs index 8111a13..270d619 100644 --- a/tests/complex-structure-serialize.rs +++ b/tests/complex-structure-serialize.rs @@ -115,7 +115,7 @@ async fn main() -> Result<(), Box> { .await?; // Let's insert some data - db.create_obj( + db.create_obj::<_, (), _>( TEST_COLLECTION_NAME, Some(&my_struct.some_id), &my_struct, diff --git a/tests/crud-integration-tests.rs b/tests/crud-integration-tests.rs index 1d2a945..e7d6a67 100644 --- a/tests/crud-integration-tests.rs +++ b/tests/crud-integration-tests.rs @@ -66,7 +66,7 @@ async fn crud_tests() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct2.some_id) .object(&my_struct2) - .execute() + .execute::<()>() .await?; assert_eq!(object_returned, my_struct1); diff --git a/tests/nested-collections-tests.rs b/tests/nested-collections-tests.rs index 6a0c25c..a794767 100644 --- a/tests/nested-collections-tests.rs +++ b/tests/nested-collections-tests.rs @@ -41,7 +41,7 @@ async fn crud_tests() -> Result<(), Box> { .into(TEST_PARENT_COLLECTION_NAME) .document_id(&parent_struct.some_id) .object(&parent_struct) - .execute() + .execute::<()>() .await?; // Creating a child doc @@ -69,7 +69,7 @@ async fn crud_tests() -> Result<(), Box> { .document_id(&child_struct.some_id) .parent(&parent_path) .object(&child_struct) - .execute() + .execute::<()>() .await?; let find_parent: Option = db diff --git a/tests/query-integration-tests.rs b/tests/query-integration-tests.rs index 8e11987..fb243dd 100644 --- a/tests/query-integration-tests.rs +++ b/tests/query-integration-tests.rs @@ -57,7 +57,7 @@ async fn crud_tests() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct1.some_id) .object(&my_struct1) - .execute() + .execute::<()>() .await?; db.fluent() @@ -65,7 +65,7 @@ async fn crud_tests() -> Result<(), Box> { .into(TEST_COLLECTION_NAME) .document_id(&my_struct2.some_id) .object(&my_struct2) - .execute() + .execute::<()>() .await?; let object_stream: BoxStream = db