Closed
Description
In bson-rust-main/src/bson.rs, the comment indicates that this method will panic when it is called on a case which contains a Decimal128
value, but the code will not panic when input is a Decimal128
/// Note: If this method is called on a case which contains a `Decimal128` value, it will panic.
pub fn into_relaxed_extjson(self) -> Value {
match self {
Bson::Double(v) if v.is_nan() => {
let s = if v.is_sign_negative() { "-NaN" } else { "NaN" };
json!({ "$numberDouble": s })
}
...
Bson::Decimal128(v) => json!({ "$numberDecimal": v.to_string() }),
...
}
}
Metadata
Metadata
Assignees
Labels
No labels