You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bson.rs
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -304,6 +304,18 @@ impl From<DbPointer> for Bson {
304
304
}
305
305
}
306
306
307
+
impl<T>From<Option<T>>forBson
308
+
where
309
+
T:Into<Bson>,
310
+
{
311
+
fnfrom(a:Option<T>) -> Bson{
312
+
match a {
313
+
None => Bson::Null,
314
+
Some(t) => t.into(),
315
+
}
316
+
}
317
+
}
318
+
307
319
/// This will create the [relaxed Extended JSON v2](https://docs.mongodb.com/manual/reference/mongodb-extended-json/) representation of the provided [`Bson`](../enum.Bson.html).
0 commit comments