Skip to content

Commit ea90bbd

Browse files
committed
Merge pull request #4 from kyeah/master
Fix boolean encoding
2 parents d470846 + af061a4 commit ea90bbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn encode_bson<W: Write + ?Sized>(writer: &mut W, key: &str, val: &Bson) -> Enco
139139
&Bson::String(ref v) => write_string(writer, &v),
140140
&Bson::Array(ref v) => encode_array(writer, &v),
141141
&Bson::Document(ref v) => encode_document(writer, v),
142-
&Bson::Boolean(v) => writer.write_u8(if v { 0x00 } else { 0x01 }).map_err(From::from),
142+
&Bson::Boolean(v) => writer.write_u8(if v { 0x01 } else { 0x00 }).map_err(From::from),
143143
&Bson::RegExp(ref pat, ref opt) => {
144144
try!(write_cstring(writer, pat));
145145
write_cstring(writer, opt)

0 commit comments

Comments
 (0)