diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b83eb6..952d2a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,11 +55,11 @@ jobs: - name: Rust cache uses: Swatinem/rust-cache@v2.7.3 - - name: Lints (compat-3-0-0) + - name: Lints (bson 2) run: cargo clippy --workspace --no-default-features --features "compat-3-0-0 rustls" -v -- -Dwarnings - - name: Lints (compat-3-3-0) - run: cargo clippy --workspace --no-default-features --features "compat-3-3-0 rustls" -v -- -Dwarnings + - name: Lints (bson 3) + run: cargo clippy --workspace --no-default-features --features "compat-3-3-0 bson-3 rustls" -v -- -Dwarnings - name: Tests run: cargo test --workspace -v diff --git a/Cargo.toml b/Cargo.toml index fb67f3a..3b2d787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,8 @@ include = ["src/**/*", "README.md", "CHANGELOG.md"] [features] default = ["compat-3-0-0", "rustls"] compat-3-0-0 = ["mongodb/compat-3-0-0"] -compat-3-3-0 = ["mongodb/compat-3-3-0", "mongodb/bson-3"] +compat-3-3-0 = ["mongodb/compat-3-3-0"] +bson-3 = ["mongodb/bson-3"] openssl = ["mongodb/openssl-tls"] rustls = ["mongodb/rustls-tls"] diff --git a/src/index.rs b/src/index.rs index 602b842..4a3e6c5 100644 --- a/src/index.rs +++ b/src/index.rs @@ -2,7 +2,7 @@ use crate::CollectionConfig; -#[cfg(feature = "compat-3-3-0")] +#[cfg(feature = "bson-3")] use mongodb::bson::deserialize_from_bson; #[cfg(feature = "compat-3-0-0")] use mongodb::bson::from_bson as deserialize_from_bson; diff --git a/src/lib.rs b/src/lib.rs index 197ee72..6bab813 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,7 +172,7 @@ impl ToRepository for mongodb::Database { pub mod prelude { #[cfg(feature = "compat-3-0-0")] pub use mongodb::bson::de::Error as BsonDeserializeError; - #[cfg(feature = "compat-3-3-0")] + #[cfg(feature = "bson-3")] pub use mongodb::bson::error::Error as BsonError; pub use crate::mongo::bson::oid::ObjectId; diff --git a/src/repository.rs b/src/repository.rs index 0be0ad9..ed21606 100644 --- a/src/repository.rs +++ b/src/repository.rs @@ -5,7 +5,7 @@ use async_trait::async_trait; use mongodb::bson::oid::ObjectId; use mongodb::bson::{Document, doc}; -#[cfg(feature = "compat-3-3-0")] +#[cfg(feature = "bson-3")] use mongodb::bson::{deserialize_from_document, serialize_to_bson}; #[cfg(feature = "compat-3-0-0")] use mongodb::bson::{from_document as deserialize_from_document, to_bson as serialize_to_bson};