Skip to content

Commit 2bc1b3e

Browse files
authored
Merge pull request #56 from zonyitoo/f64-fix
Fix json f64 value conversion
2 parents 5c88d23 + 467f89e commit 2bc1b3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bson.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl Bson {
320320
match j {
321321
&Value::Number(ref x) =>
322322
x.as_i64().map(Bson::from)
323-
.or(x.as_u64().map(Bson::from))
323+
.or_else(|| x.as_f64().map(Bson::from))
324324
.expect(&format!("Invalid number value: {}", x)),
325325
&Value::String(ref x) => x.into(),
326326
&Value::Bool(x) => x.into(),

0 commit comments

Comments
 (0)