Skip to content

Commit ced93a7

Browse files
committed
run lints
1 parent 666557b commit ced93a7

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

src/binary.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
pub mod error;
2-
use std::fmt::{self, Display};
3-
use crate::{spec::BinarySubtype, RawBinaryRef, Document, binary::error::{Result, Error}};
4-
use std::convert::TryFrom;
2+
use crate::{
3+
binary::error::{Error, Result},
4+
spec::BinarySubtype,
5+
Document,
6+
RawBinaryRef,
7+
};
8+
use std::{
9+
convert::TryFrom,
10+
fmt::{self, Display},
11+
};
512

613
/// Represents a BSON binary value.
714
#[derive(Debug, Clone, PartialEq)]
@@ -28,10 +35,7 @@ impl Binary {
2835
/// Creates a [`Binary`] from a base64 string and optional [`BinarySubtype`]. If the
2936
/// `subtype` argument is `None`, the [`Binary`] constructed will default to
3037
/// [`BinarySubtype::Generic`].
31-
pub fn from_base64(
32-
input: &str,
33-
subtype: impl Into<Option<BinarySubtype>>,
34-
) -> Result<Self> {
38+
pub fn from_base64(input: &str, subtype: impl Into<Option<BinarySubtype>>) -> Result<Self> {
3539
let bytes = base64::decode(input).map_err(|_| Error::DecodingError)?;
3640
let subtype = match subtype.into() {
3741
Some(s) => s,

src/binary/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ impl std::fmt::Display for Error {
1818
}
1919
}
2020

21-
pub type Result<T> = std::result::Result<T, Error>;
21+
pub type Result<T> = std::result::Result<T, Error>;

src/bson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ use serde_json::{json, Value};
3030

3131
pub use crate::document::Document;
3232
use crate::{
33+
binary::Binary,
3334
oid::{self, ObjectId},
3435
spec::{BinarySubtype, ElementType},
3536
Decimal128,
36-
binary::Binary,
3737
};
3838

3939
/// Possible BSON value types.

src/de/mod.rs

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

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

src/de/serde.rs

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

2323
use crate::{
24-
bson::{Bson, DbPointer, JavaScriptCodeWithScope, Regex, Timestamp},
2524
binary::Binary,
25+
bson::{Bson, DbPointer, JavaScriptCodeWithScope, Regex, Timestamp},
2626
datetime::DateTime,
2727
document::{Document, IntoIter},
2828
oid::ObjectId,

src/document.rs

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

1515
use crate::{
16+
binary::Binary,
1617
bson::{Array, Bson, Timestamp},
1718
de::{deserialize_bson_kvp, ensure_read_exactly, read_i32, MIN_BSON_DOCUMENT_SIZE},
18-
binary::Binary,
1919
oid::ObjectId,
2020
ser::{serialize_bson, write_i32},
2121
spec::BinarySubtype,

0 commit comments

Comments
 (0)