Skip to content

Commit 666557b

Browse files
committed
create binary error type
1 parent 15077de commit 666557b

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/bson.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ use std::{
2626
fmt::{self, Debug, Display, Formatter},
2727
};
2828

29-
use base64::DecodeError;
3029
use serde_json::{json, Value};
3130

3231
pub use crate::document::Document;
3332
use crate::{
3433
oid::{self, ObjectId},
3534
spec::{BinarySubtype, ElementType},
3635
Decimal128,
37-
RawBinaryRef,
36+
binary::Binary,
3837
};
3938

4039
/// Possible BSON value types.

src/de/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pub use self::{
3333
use std::io::Read;
3434

3535
use crate::{
36-
bson::{Array, Binary, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
36+
bson::{Array, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
37+
binary::Binary,
3738
oid::{self, ObjectId},
3839
raw::RawBinaryRef,
3940
ser::write_i32,

src/de/serde.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ use serde::de::{
2121
use serde_bytes::ByteBuf;
2222

2323
use crate::{
24-
bson::{Binary, Bson, DbPointer, JavaScriptCodeWithScope, Regex, Timestamp},
24+
bson::{Bson, DbPointer, JavaScriptCodeWithScope, Regex, Timestamp},
25+
binary::Binary,
2526
datetime::DateTime,
2627
document::{Document, IntoIter},
2728
oid::ObjectId,

src/document.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ use indexmap::IndexMap;
1313
use serde::de::Error;
1414

1515
use crate::{
16-
bson::{Array, Binary, Bson, Timestamp},
16+
bson::{Array, Bson, Timestamp},
1717
de::{deserialize_bson_kvp, ensure_read_exactly, read_i32, MIN_BSON_DOCUMENT_SIZE},
18+
binary::Binary,
1819
oid::ObjectId,
1920
ser::{serialize_bson, write_i32},
2021
spec::BinarySubtype,

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@
269269

270270
#[doc(inline)]
271271
pub use self::{
272-
bson::{Array, Binary, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
272+
bson::{Array, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
273273
datetime::DateTime,
274+
binary::Binary,
274275
de::{
275276
from_bson, from_bson_with_options, from_document, from_document_with_options, from_reader,
276277
from_reader_utf8_lossy, from_slice, from_slice_utf8_lossy, Deserializer,
@@ -291,6 +292,7 @@ pub use self::{
291292
#[macro_use]
292293
mod macros;
293294
mod bson;
295+
pub mod binary;
294296
pub mod datetime;
295297
pub mod de;
296298
pub mod decimal128;

0 commit comments

Comments
 (0)