From 561e5d737befb5b7e190ecd84059ff2ff2581341 Mon Sep 17 00:00:00 2001 From: Matrix <113445886@qq.com> Date: Mon, 9 Apr 2018 11:11:21 +0800 Subject: [PATCH] fix build fail with msvc --- src/bsonc.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/bsonc.rs b/src/bsonc.rs index 45bf2d6..e2034ea 100644 --- a/src/bsonc.rs +++ b/src/bsonc.rs @@ -2,7 +2,7 @@ use std::ffi::CStr; use std::ptr; use std::fmt; use std::slice; -use libc::c_void; +use libc::{c_uint, c_void}; use mongoc::bindings; use bson; @@ -27,12 +27,8 @@ impl Bsonc { let mut buffer = Vec::new(); try!(bson::encode_document(&mut buffer, document)); - let inner = unsafe { - bindings::bson_new_from_data( - buffer[..].as_ptr(), - buffer.len() as u64 - ) - }; + let inner = + unsafe { bindings::bson_new_from_data(buffer[..].as_ptr(), buffer.len() as c_uint) }; // Inner will be null if there was an error converting the data. // We're assuming the bson crate works and therefore assert here.