diff --git a/src/bson.rs b/src/bson.rs index 03b8bee0..98a6bb96 100644 --- a/src/bson.rs +++ b/src/bson.rs @@ -308,12 +308,6 @@ impl From for Bson { } } -impl From for Bson { - fn from(a: u64) -> Bson { - Bson::Int64(a as i64) - } -} - impl From<[u8; 12]> for Bson { fn from(a: [u8; 12]) -> Bson { Bson::ObjectId(oid::ObjectId::from_bytes(a)) diff --git a/src/extjson/de.rs b/src/extjson/de.rs index 89b36804..0d12857e 100644 --- a/src/extjson/de.rs +++ b/src/extjson/de.rs @@ -196,7 +196,6 @@ impl TryFrom for Bson { Bson::Int64(i) } }) - .or_else(|| x.as_u64().map(Bson::from)) .or_else(|| x.as_f64().map(Bson::from)) .ok_or_else(|| { Error::invalid_value( diff --git a/src/tests/modules/bson.rs b/src/tests/modules/bson.rs index bfc7f8a3..333e1e89 100644 --- a/src/tests/modules/bson.rs +++ b/src/tests/modules/bson.rs @@ -114,7 +114,6 @@ fn from_impls() { assert_eq!(Bson::from(-48i32), Bson::Int32(-48)); assert_eq!(Bson::from(-96i64), Bson::Int64(-96)); assert_eq!(Bson::from(152u32), Bson::Int32(152)); - assert_eq!(Bson::from(4096u64), Bson::Int64(4096)); let oid = ObjectId::new(); assert_eq!(