Skip to content

Commit d4f20e2

Browse files
committed
Merge pull request #27 from DenisKolodin/string-fix
Fix String conversion cases
2 parents 79bd83e + 6c98831 commit d4f20e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bson.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ impl<'a> From<&'a str> for Bson {
127127

128128
impl From<String> for Bson {
129129
fn from(a: String) -> Bson {
130+
Bson::String(a)
131+
}
132+
}
133+
134+
impl<'a> From<&'a String> for Bson {
135+
fn from(a: &'a String) -> Bson {
130136
Bson::String(a.to_owned())
131137
}
132138
}

0 commit comments

Comments
 (0)