Skip to content

Commit 84ced4d

Browse files
authored
RUST-846 Update Bson's Display impl to use driver type names (#271)
1 parent adb3a06 commit 84ced4d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/bson.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ impl Display for Bson {
127127
}
128128
Bson::Binary(Binary { subtype, ref bytes }) => write!(
129129
fmt,
130-
"BinData({:#x}, {})",
130+
"Binary({:#x}, {})",
131131
u8::from(subtype),
132132
base64::encode(bytes)
133133
),
134134
Bson::ObjectId(ref id) => write!(fmt, "ObjectId(\"{}\")", id),
135-
Bson::DateTime(date_time) => write!(fmt, "Date(\"{}\")", date_time),
135+
Bson::DateTime(date_time) => write!(fmt, "DateTime(\"{}\")", date_time),
136136
Bson::Symbol(ref sym) => write!(fmt, "Symbol(\"{}\")", sym),
137137
Bson::Decimal128(ref d) => write!(fmt, "{}", d),
138138
Bson::Undefined => write!(fmt, "undefined"),
@@ -141,7 +141,7 @@ impl Display for Bson {
141141
Bson::DbPointer(DbPointer {
142142
ref namespace,
143143
ref id,
144-
}) => write!(fmt, "DBPointer({}, {})", namespace, id),
144+
}) => write!(fmt, "DbPointer({}, {})", namespace, id),
145145
}
146146
}
147147
}

src/tests/modules/macros.rs

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

0 commit comments

Comments
 (0)