File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ fn smoke() {
79
79
}
80
80
81
81
let v = Foo { a : 2 } ;
82
- assert_eq ! ( serialize!( v) , bdoc! { "a" => ( 2 as i64 ) } ) ;
82
+ assert_eq ! ( serialize!( v) , bdoc! { "a" => ( 2_i64 ) } ) ;
83
83
assert_eq ! ( v, deserialize!( serialize!( v) ) ) ;
84
84
}
85
85
@@ -91,11 +91,11 @@ fn smoke_under() {
91
91
}
92
92
93
93
let v = Foo { a_b : 2 } ;
94
- assert_eq ! ( serialize!( v) , bdoc! { "a_b" => ( 2 as i64 ) } ) ;
94
+ assert_eq ! ( serialize!( v) , bdoc! { "a_b" => ( 2_i64 ) } ) ;
95
95
assert_eq ! ( v, deserialize!( serialize!( v) ) ) ;
96
96
97
97
let mut m = BTreeMap :: new ( ) ;
98
- m. insert ( "a_b" . to_string ( ) , 2 as i64 ) ;
98
+ m. insert ( "a_b" . to_string ( ) , 2_i64 ) ;
99
99
assert_eq ! ( v, deserialize!( serialize!( m) ) ) ;
100
100
}
101
101
@@ -120,7 +120,7 @@ fn nested() {
120
120
assert_eq ! (
121
121
serialize!( v) ,
122
122
bdoc! {
123
- "a" => ( 2 as i64 ) ,
123
+ "a" => ( 2_i64 ) ,
124
124
"b" => {
125
125
"a" => "test"
126
126
}
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ pub(crate) fn deserialize_bson_kvp<R: Read + ?Sized>(
212
212
Some ( ElementType :: Array ) => deserialize_array ( reader, utf8_lossy) . map ( Bson :: Array ) ?,
213
213
Some ( ElementType :: Binary ) => {
214
214
let mut len = read_i32 ( reader) ?;
215
- if len < 0 || len > MAX_BSON_SIZE {
215
+ if ! ( 0 ..= MAX_BSON_SIZE ) . contains ( & len ) {
216
216
return Err ( Error :: invalid_length (
217
217
len as usize ,
218
218
& format ! ( "binary length must be between 0 and {}" , MAX_BSON_SIZE ) . as_str ( ) ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ fn byte_string_oid() {
27
27
}
28
28
29
29
#[ test]
30
+ #[ allow( clippy:: eq_op) ]
30
31
fn oid_equals ( ) {
31
32
let _guard = LOCK . run_concurrently ( ) ;
32
33
let oid = ObjectId :: new ( ) ;
You can’t perform that action at this time.
0 commit comments