fix datetime decode
@@ -51,6 +51,11 @@ impl<'de> serde::Deserialize<'de> for DateTimeUtc {
});
}
Bson::String(s) => {
+ let mut b = s.into_bytes();
+ if b.len() >= 10 && b[10] == ' ' as u8 {
+ b[10] = 'T' as u8;
+ }
+ let s = unsafe { String::from_utf8_unchecked(b) };
if s.starts_with("DateTimeUtc(") && s.ends_with(")") {
let inner_data = &s["DateTimeUtc(".len()..(s.len() - 1)];
return Ok(Self {
