File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3556,6 +3556,7 @@ mod test_map {
3556
3556
assert_eq ! ( m. len( ) , 1 ) ;
3557
3557
assert ! ( m. insert( 2 , 4 ) . is_none( ) ) ;
3558
3558
assert_eq ! ( m. len( ) , 2 ) ;
3559
+ #[ allow( clippy:: redundant_clone) ]
3559
3560
let m2 = m. clone ( ) ;
3560
3561
assert_eq ! ( * m2. get( & 1 ) . unwrap( ) , 2 ) ;
3561
3562
assert_eq ! ( * m2. get( & 2 ) . unwrap( ) , 4 ) ;
@@ -4191,6 +4192,7 @@ mod test_map {
4191
4192
map. insert ( 2 , 1 ) ;
4192
4193
map. insert ( 3 , 4 ) ;
4193
4194
4195
+ #[ allow( clippy:: no_effect) ] // false positive lint
4194
4196
map[ & 4 ] ;
4195
4197
}
4196
4198
Original file line number Diff line number Diff line change @@ -17,14 +17,16 @@ fn test_hashset_insert_remove() {
17
17
. map ( |_| ( rng. sample_iter ( & Alphanumeric ) . take ( 32 ) . collect ( ) ) )
18
18
. collect ( ) ;
19
19
20
+ // more readable with explicit `true` / `false`
21
+ #[ allow( clippy:: bool_assert_comparison) ]
20
22
for _ in 0 ..32 {
21
- for i in 0 .. 4096 {
22
- assert_eq ! ( m. contains( & tx [ i ] . clone ( ) ) , false ) ;
23
- assert_eq ! ( m. insert( tx [ i ] . clone( ) ) , true ) ;
23
+ for x in tx . iter ( ) {
24
+ assert_eq ! ( m. contains( x ) , false ) ;
25
+ assert_eq ! ( m. insert( x . clone( ) ) , true ) ;
24
26
}
25
- for i in 0 .. 4096 {
26
- println ! ( "removing {} {:?}" , i, tx [ i ] ) ;
27
- assert_eq ! ( m. remove( & tx [ i ] ) , true ) ;
27
+ for ( i , x ) in tx . iter ( ) . enumerate ( ) {
28
+ println ! ( "removing {} {:?}" , i, x ) ;
29
+ assert_eq ! ( m. remove( x ) , true ) ;
28
30
}
29
31
}
30
32
}
You can’t perform that action at this time.
0 commit comments