Compare commits

..

No commits in common. 'main' and 'snappy' have entirely different histories.
main ... snappy

@ -1,21 +1,3 @@
# 0.14.2
* Disable zstd if package is not found
# 0.14.1
* Disable snappy if package is not found
# 0.14.0
* Bump mongoc to 1.22.0
# 0.13.6
* Memory leak fix in Bscon::new by (by austinjones)
# 0.13.5
* Hard version lock on sys dependency
# 0.13.4
* Tweak linking options, use snappy if available
# 0.13.3
* Upgrade libmongoc to 1.17.4
* Another static linking fix

@ -1,6 +1,6 @@
[package]
name = "mongo_driver"
version = "0.14.2"
version = "0.13.3"
authors = ["Thijs Cadier <thijs@appsignal.com>"]
description = "Mongo Rust driver built on top of the Mongo C driver"
readme = "README.md"
@ -24,7 +24,7 @@ serde_derive = "1.0"
[dependencies.mongoc-sys]
path = "mongoc-sys"
version = "=1.22.0-2"
version = "1.17.5"
[dev-dependencies]
chrono = "^0.4"

@ -1,6 +1,6 @@
[package]
name = "mongoc-sys"
version = "1.22.0-2"
version = "1.17.5"
description = "Sys package with installer and bindings for mongoc"
authors = ["Thijs Cadier <thijs@appsignal.com>"]
build = "build.rs"

@ -10,6 +10,14 @@ fn main() {
.next()
.expect("Crate version is not valid");
let pkg = pkg_config::Config::new();
pkg.probe("zlib").expect("Cannot find zlib");
#[cfg(target_os = "linux")] pkg.probe("icu-i18n").expect("Cannot find icu");
match pkg.probe("snappy") {
Ok(_) => (),
Err(e) => println!("Snappy not found: {}", e)
}
let out_dir_var = env::var("OUT_DIR").expect("No out dir");
let out_dir = Path::new(&out_dir_var);
let driver_src_path = out_dir.join(format!("mongo-c-driver-{}", mongoc_version));
@ -47,28 +55,6 @@ fn main() {
let mut cmake = Command::new("cmake");
cmake.current_dir(&driver_src_path);
let pkg = pkg_config::Config::new();
pkg.probe("zlib").expect("Cannot find zlib");
#[cfg(target_os = "linux")] pkg.probe("icu-i18n").expect("Cannot find icu");
match pkg.probe("snappy") {
Ok(_) => {
cmake.arg("-DENABLE_SNAPPY=ON");
},
Err(e) => {
println!("Snappy not found: {}", e);
cmake.arg("-DENABLE_SNAPPY=OFF");
}
}
match pkg.probe("zstd") {
Ok(_) => {
cmake.arg("-DENABLE_ZSTD=ON");
},
Err(e) => {
println!("Zstd not found: {}", e);
cmake.arg("-DENABLE_ZSTD=OFF");
}
}
cmake.arg("-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF");
cmake.arg("-DENABLE_SSL=OPENSSL");
cmake.arg("-DENABLE_SASL=OFF");

@ -16,12 +16,7 @@ pub struct Bsonc {
impl Bsonc {
pub fn new() -> Bsonc {
let inner: *const bindings::bson_t = unsafe { bindings::bson_new() };
assert!(!inner.is_null());
Bsonc {
inner: inner as *mut bindings::bson_t,
destroy_inner_on_drop: true,
}
Bsonc::from_ptr(unsafe { bindings::bson_new() })
}
/// Create a bsonc from a raw pointer. Does not run cleanup
@ -116,13 +111,6 @@ impl Drop for Bsonc {
#[cfg(test)]
mod tests {
#[test]
fn test_bsonc_new() {
for _ in 0..100 {
let _ = super::Bsonc::new();
}
}
#[test]
fn test_bsonc_from_and_as_document() {
let document = doc! { "key": "value" };

@ -45,7 +45,8 @@ pub struct Database<'a> {
}
impl<'a> Database<'a> {
pub(crate) fn new(
#[doc(ignore)]
pub fn new(
created_by: CreatedBy<'a>,
inner: *mut bindings::mongoc_database_t
) -> Database<'a> {

Loading…
Cancel
Save