Skip to content

Commit 94eba4e

Browse files
RUST-457 Fix Display implementation for Binary type (#180)
1 parent 9aec6bc commit 94eba4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Display for Bson {
130130
}
131131
Bson::Binary(Binary { subtype, ref bytes }) => write!(
132132
fmt,
133-
"BinData({}, 0x{})",
133+
"BinData({:#x}, {})",
134134
u8::from(subtype),
135135
base64::encode(bytes)
136136
),

tests/modules/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ fn standard_format() {
3939
"{{ float: 2.4, string: \"hello\", array: [\"testing\", 1, true, [1, 2]], doc: {{ fish: \
4040
\"in\", a: \"barrel\", !: 1 }}, bool: true, null: null, regexp: /s[ao]d/i, \
4141
with_wrapped_parens: -20, code: function(x) {{ return x._id; }}, i32: 12, i64: -55, \
42-
timestamp: Timestamp(0, 229999444), binary: BinData(5, 0x{}), encrypted: BinData(6, \
43-
0x{}), _id: ObjectId(\"{}\"), date: Date(\"{}\") }}",
42+
timestamp: Timestamp(0, 229999444), binary: BinData(0x5, {}), encrypted: BinData(0x6, \
43+
{}), _id: ObjectId(\"{}\"), date: Date(\"{}\") }}",
4444
base64::encode("thingies"),
4545
base64::encode("secret"),
4646
hex::encode(id_string),

0 commit comments

Comments
 (0)