Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 53 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["driver", "macros", "benchmarks"]
members = ["driver", "macros", "benchmarks", "etc/update_version"]

[workspace.package]
authors = [
Expand All @@ -14,4 +14,4 @@ authors = [
license = "Apache-2.0"
edition = "2021"
repository = "https://github.com/mongodb/mongo-rust-driver"
rust-version = "1.83"
rust-version = "1.83"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The driver is available on [crates.io](https://crates.io/crates/mongodb). To use

```toml
[dependencies]
mongodb = "3.3.0"
mongodb = "3.4.0"
```

Version 1 of this crate has reached end of life and will no longer be receiving any updates or bug fixes, so all users are recommended to always depend on the latest 2.x release. See the [2.0.0 release notes](https://github.com/mongodb/mongo-rust-driver/releases/tag/v2.0.0) for migration information if upgrading from a 1.x version.
Expand All @@ -34,7 +34,7 @@ The driver also provides a blocking sync API. To enable this, add the `"sync"` f

```toml
[dependencies.mongodb]
version = "3.3.0"
version = "3.4.0"
features = ["sync"]
```

Expand Down
6 changes: 3 additions & 3 deletions driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ categories = ["asynchronous", "database", "web-programming"]
homepage = "https://www.mongodb.com/docs/drivers/rust/"
readme = "../README.md"
name = "mongodb"
version = "3.3.0"
version = "3.4.0"

authors.workspace = true
license.workspace = true
Expand Down Expand Up @@ -97,7 +97,7 @@ hickory-resolver = { version = "0.25", optional = true }
hmac = "0.12.1"
log = { version = "0.4.17", optional = true }
md-5 = "0.10.1"
mongodb-internal-macros = { path = "../macros", version = "3.3.0" }
mongodb-internal-macros = { path = "../macros", version = "3.4.0" }
num_cpus = { version = "1.13.1", optional = true }
openssl = { version = "0.10.38", optional = true }
openssl-probe = { version = "0.1.5", optional = true }
Expand Down Expand Up @@ -164,7 +164,7 @@ optional = true
features = ["serde"]

[dependencies.mongocrypt]
version = "0.3.1"
version = "0.3.2"
git = "https://github.com/mongodb/libmongocrypt-rust.git"
branch = "main"
default-features = false
Expand Down
2 changes: 1 addition & 1 deletion driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(test, type_length_limit = "80000000")]
#![doc(html_root_url = "https://docs.rs/mongodb/3.3.0")]
#![doc(html_root_url = "https://docs.rs/mongodb/3.4.0")]

#[macro_use]
pub mod options;
Expand Down
7 changes: 6 additions & 1 deletion etc/update_version/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "update_version"
version = "0.1.0"
edition = "2021"

authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
rust-version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
28 changes: 16 additions & 12 deletions etc/update_version/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ impl PendingUpdates {
}

fn apply(&mut self, location: &Location, update: &str) {
let text = self
.files
.entry(location.path)
.or_insert_with(|| std::fs::read_to_string(location.path).unwrap());
let text = self.files.entry(location.path).or_insert_with(|| {
std::fs::read_to_string(location.path).expect(
std::path::absolute(location.path)
.unwrap()
.to_str()
.unwrap(),
)
});

if !location.pattern.is_match(text) {
panic!("no match for {:?}", location);
Expand Down Expand Up @@ -81,19 +85,19 @@ fn main() {
// nosemgrep: current-exe
let zero = std::env::current_exe().unwrap();
let self_dir = zero.parent().unwrap();
let main_dir = self_dir.join("../../../..");
let main_dir = self_dir.join("..").join("..");
std::env::set_current_dir(main_dir).unwrap();

let args: Args = argh::from_env();

let version_locs = vec![
Location::new(
"Cargo.toml",
"driver/Cargo.toml",
r#"name = "mongodb"\nversion = "(?<target>.*?)"\n"#,
),
Location::new(
"Cargo.toml",
r#"mongodb-internal-macros = \{ path = "macros", version = "(?<target>.*?)" \}\n"#,
"driver/Cargo.toml",
r#"mongodb-internal-macros = \{ path = "../macros", version = "(?<target>.*?)" \}\n"#,
),
Location::new(
"macros/Cargo.toml",
Expand All @@ -105,7 +109,7 @@ fn main() {
r#"\[dependencies.mongodb\]\nversion = "(?<target>.*?)"\n"#,
),
Location::new(
"src/lib.rs",
"driver/src/lib.rs",
r#"html_root_url = "https://docs.rs/mongodb/(?<target>.*?)""#,
),
];
Expand All @@ -116,23 +120,23 @@ fn main() {

if let Some(bson2) = args.bson2 {
let bson_version_loc = Location::new(
"Cargo.toml",
"driver/Cargo.toml",
r#"\[dependencies.bson2\]\nversion = "(?<target>.*?)"\n"#,
);
pending.apply(&bson_version_loc, &bson2);
}

if let Some(bson3) = args.bson3 {
let bson_version_loc = Location::new(
"Cargo.toml",
"driver/Cargo.toml",
r#"\[dependencies.bson3\]\nversion = "(?<target>.*?)"\n"#,
);
pending.apply(&bson_version_loc, &bson3);
}

if let Some(mongocrypt) = args.mongocrypt {
let mongocrypt_version_loc = Location::new(
"Cargo.toml",
"driver/Cargo.toml",
r#"\[dependencies.mongocrypt\]\nversion = "(?<target>.*?)".*"#,
);
pending.apply(&mongocrypt_version_loc, &mongocrypt);
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mongodb-internal-macros"
version = "3.3.0"
version = "3.4.0"
description = "Internal macros for the mongodb crate"

authors.workspace = true
Expand Down