From 43340343d1cbc1927891e5831ddbe044988e4fc9 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 22 Dec 2023 10:30:50 -0500 Subject: [PATCH 1/3] minor: bump indexmap to `2.1.0` --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index df7e6a2b..21d66256 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ chrono = { version = "0.4.15", features = ["std"], default-features = false, opt rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["preserve_order"] } -indexmap = "1.6.2" +indexmap = "2.1.0" hex = "0.4.2" base64 = "0.13.0" once_cell = "1.5.1" From bff904d42aa68ce4bbcc7295fc60abbc7e3d768e Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 8 Jan 2024 11:45:59 -0500 Subject: [PATCH 2/3] bump MSRV to 1.64 --- README.md | 4 ++-- clippy.toml | 2 +- src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 87e89fb4..b0aaaf95 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Note that if you are using `bson` through the `mongodb` crate, you do not need t | `uuid-0_8` | Enable support for v0.8 of the [`uuid`](https://docs.rs/uuid/0.8) crate in the public API. | n/a | no | | `uuid-1` | Enable support for v1.x of the [`uuid`](https://docs.rs/uuid/1.0) crate in the public API. | n/a | no | | `serde_with` | Enable [`serde_with`](https://docs.rs/serde_with/1.x) 1.x integrations for `bson::DateTime` and `bson::Uuid`.| serde_with | no | -| `serde_with-3` | Enable [`serde_with`](https://docs.rs/serde_with/3.x) 3.x integrations for `bson::DateTime` and `bson::Uuid`. Requires Rust 1.61. | serde_with | no | +| `serde_with-3` | Enable [`serde_with`](https://docs.rs/serde_with/3.x) 3.x integrations for `bson::DateTime` and `bson::Uuid`.| serde_with | no | ## Overview of the BSON Format BSON, short for Binary JSON, is a binary-encoded serialization of JSON-like documents. @@ -257,7 +257,7 @@ This crate compiles to the `wasm32-unknown-unknown` target; when doing so, the ` ## Minimum supported Rust version (MSRV) -The MSRV for this crate is currently 1.61.0. This will be rarely be increased, and if it ever is, +The MSRV for this crate is currently 1.64.0. This will be rarely be increased, and if it ever is, it will only happen in a minor or major version release. ## Contributing diff --git a/clippy.toml b/clippy.toml index f6c82f96..3eb5fd06 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.61.0" \ No newline at end of file +msrv = "1.64.0" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 811f0f0a..1f5dda48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,7 +43,7 @@ //! //! ## Installation //! ### Requirements -//! - Rust 1.61+ +//! - Rust 1.64+ //! //! ### Importing //! This crate is available on [crates.io](https://crates.io/crates/bson). To use it in your application, @@ -267,7 +267,7 @@ //! //! ## Minimum supported Rust version (MSRV) //! -//! The MSRV for this crate is currently 1.61.0. This will be rarely be increased, and if it ever is, +//! The MSRV for this crate is currently 1.64.0. This will be rarely be increased, and if it ever is, //! it will only happen in a minor or major version release. #![allow(clippy::cognitive_complexity, clippy::derive_partial_eq_without_eq)] From 4a80a0304194a5d766cd646761261a12a52107c8 Mon Sep 17 00:00:00 2001 From: Isabel Atkinson Date: Tue, 9 Jan 2024 10:30:34 -0700 Subject: [PATCH 3/3] update config and fix clippy failure --- .evergreen/config.yml | 4 ++-- src/bson.rs | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index a41831ab..d27fca57 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -195,9 +195,9 @@ axes: - id: "extra-rust-versions" values: - id: "min" - display_name: "1.61 (minimum supported version)" + display_name: "1.64 (minimum supported version)" variables: - RUST_VERSION: "1.61.0" + RUST_VERSION: "1.64.0" MSRV: "true" - id: "nightly" display_name: "nightly" diff --git a/src/bson.rs b/src/bson.rs index 92f93a8b..07a424a3 100644 --- a/src/bson.rs +++ b/src/bson.rs @@ -37,7 +37,7 @@ use crate::{ }; /// Possible BSON value types. -#[derive(Clone, PartialEq)] +#[derive(Clone, Default, PartialEq)] pub enum Bson { /// 64-bit binary floating point Double(f64), @@ -50,6 +50,7 @@ pub enum Bson { /// Boolean value Boolean(bool), /// Null value + #[default] Null, /// Regular expression RegularExpression(Regex), @@ -86,12 +87,6 @@ pub enum Bson { /// Alias for `Vec`. pub type Array = Vec; -impl Default for Bson { - fn default() -> Self { - Bson::Null - } -} - impl Display for Bson { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match *self {