Skip to content

Commit 88ae843

Browse files
authored
RUST-882 Remove lossy From<u64> impl for Bson (#280)
1 parent 7ccf82b commit 88ae843

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

src/bson.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,6 @@ impl From<u32> for Bson {
308308
}
309309
}
310310

311-
impl From<u64> for Bson {
312-
fn from(a: u64) -> Bson {
313-
Bson::Int64(a as i64)
314-
}
315-
}
316-
317311
impl From<[u8; 12]> for Bson {
318312
fn from(a: [u8; 12]) -> Bson {
319313
Bson::ObjectId(oid::ObjectId::from_bytes(a))

src/extjson/de.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ impl TryFrom<serde_json::Value> for Bson {
196196
Bson::Int64(i)
197197
}
198198
})
199-
.or_else(|| x.as_u64().map(Bson::from))
200199
.or_else(|| x.as_f64().map(Bson::from))
201200
.ok_or_else(|| {
202201
Error::invalid_value(

src/tests/modules/bson.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ fn from_impls() {
114114
assert_eq!(Bson::from(-48i32), Bson::Int32(-48));
115115
assert_eq!(Bson::from(-96i64), Bson::Int64(-96));
116116
assert_eq!(Bson::from(152u32), Bson::Int32(152));
117-
assert_eq!(Bson::from(4096u64), Bson::Int64(4096));
118117

119118
let oid = ObjectId::new();
120119
assert_eq!(

0 commit comments

Comments
 (0)