File tree Expand file tree Collapse file tree 13 files changed +26
-24
lines changed Expand file tree Collapse file tree 13 files changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ set -o errexit
5
5
source ./.evergreen/env.sh
6
6
7
7
# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
8
- CLIPPY_VERSION=1.75 .0
8
+ CLIPPY_VERSION=1.78 .0
9
9
10
10
rustup install $CLIPPY_VERSION
11
11
12
12
# Check with default features.
13
13
cargo +$CLIPPY_VERSION clippy --all-targets -p mongodb -- -D warnings
14
14
15
15
# Check with all features.
16
- cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p mongodb -- -D warnings
16
+ cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p mongodb -- -D warnings
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ impl Cache {
279
279
self . idp_server_info = idp_server_info;
280
280
}
281
281
self . access_token = Some ( response. access_token . clone ( ) ) ;
282
- self . refresh_token = response. refresh_token . clone ( ) ;
282
+ self . refresh_token . clone_from ( & response. refresh_token ) ;
283
283
self . last_call_time = Instant :: now ( ) ;
284
284
self . token_gen_id += 1 ;
285
285
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl Action for ParseConnectionString {
21
21
let mut options = ClientOptions :: from_connection_string ( conn_str) ;
22
22
#[ cfg( feature = "dns-resolver" ) ]
23
23
{
24
- options. resolver_config = self . resolver_config . clone ( ) ;
24
+ options. resolver_config . clone_from ( & self . resolver_config ) ;
25
25
}
26
26
27
27
let resolved = host_info. resolve ( self . resolver_config ) . await ?;
Original file line number Diff line number Diff line change 4
4
#![ warn( clippy:: cast_possible_truncation) ]
5
5
#![ warn( clippy:: cast_possible_wrap) ]
6
6
#![ cfg_attr(
7
- feature = "cargo- clippy" ,
7
+ feature = "clippy" ,
8
8
allow(
9
9
clippy:: unreadable_literal,
10
10
clippy:: cognitive_complexity,
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ impl TopologyDescription {
175
175
}
176
176
177
177
self . single_seed = self . servers . len ( ) == 1 ;
178
- self . set_name = options. repl_set_name . clone ( ) ;
178
+ self . set_name . clone_from ( & options. repl_set_name ) ;
179
179
self . local_threshold = options. local_threshold ;
180
180
self . heartbeat_freq = options. heartbeat_freq ;
181
181
self . srv_max_hosts = options. srv_max_hosts ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ async fn run_test_extra(
43
43
new_hosts : Result < Vec < ServerAddress > > ,
44
44
) -> HashSet < ServerAddress > {
45
45
let mut options = ClientOptions :: new_srv ( ) ;
46
- options. hosts = DEFAULT_HOSTS . clone ( ) ;
46
+ options. hosts . clone_from ( & DEFAULT_HOSTS ) ;
47
47
options. test_options_mut ( ) . disable_monitoring_threads = true ;
48
48
options. srv_max_hosts = max_hosts;
49
49
let mut topology = Topology :: new ( options. clone ( ) ) . unwrap ( ) ;
@@ -132,7 +132,7 @@ async fn load_balanced_no_srv_polling() {
132
132
let hosts = vec ! [ localhost_test_build_10gen( 27017 ) ] ;
133
133
let mut options = ClientOptions :: new_srv ( ) ;
134
134
let rescan_interval = options. original_srv_info . as_ref ( ) . cloned ( ) . unwrap ( ) . min_ttl ;
135
- options. hosts = hosts . clone ( ) ;
135
+ options. hosts . clone_from ( & hosts ) ;
136
136
options. load_balanced = Some ( true ) ;
137
137
options. test_options_mut ( ) . mock_lookup_hosts = Some ( make_lookup_hosts ( vec ! [
138
138
localhost_test_build_10gen( 27017 ) ,
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ pub(crate) static DEFAULT_GLOBAL_TRACING_HANDLER: Lazy<TracingHandler> = Lazy::n
114
114
115
115
pub ( crate ) fn update_options_for_testing ( options : & mut ClientOptions ) {
116
116
if options. server_api . is_none ( ) {
117
- options. server_api = SERVER_API . clone ( ) ;
117
+ options. server_api . clone_from ( & SERVER_API ) ;
118
118
}
119
119
120
120
#[ cfg( any(
Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ async fn run_test(mut test_file: TestFile) {
135
135
} else {
136
136
let mut options_with_tls = options. clone ( ) ;
137
137
if requires_tls {
138
- options_with_tls. tls = get_client_options ( ) . await . tls . clone ( ) ;
138
+ options_with_tls
139
+ . tls
140
+ . clone_from ( & get_client_options ( ) . await . tls ) ;
139
141
}
140
142
141
143
let client = Client :: with_options ( options_with_tls) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -138,9 +138,8 @@ async fn retry_read_pool_cleared() {
138
138
. expect ( "pool clear should occur" ) ;
139
139
140
140
let next_cmap_events = subscriber
141
- . collect_events ( Duration :: from_millis ( 1000 ) , |event| match event {
142
- Event :: Cmap ( _) => true ,
143
- _ => false ,
141
+ . collect_events ( Duration :: from_millis ( 1000 ) , |event| {
142
+ matches ! ( event, Event :: Cmap ( _) )
144
143
} )
145
144
. await ;
146
145
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ async fn run_legacy() {
49
49
continue ;
50
50
}
51
51
let mut options = test_case. client_options . unwrap_or_default ( ) ;
52
- options. hosts = get_client_options ( ) . await . hosts . clone ( ) ;
52
+ options. hosts . clone_from ( & get_client_options ( ) . await . hosts ) ;
53
53
if options. heartbeat_freq . is_none ( ) {
54
54
options. heartbeat_freq = Some ( MIN_HEARTBEAT_FREQUENCY ) ;
55
55
}
@@ -455,9 +455,8 @@ async fn retry_write_pool_cleared() {
455
455
. expect ( "pool clear should occur" ) ;
456
456
457
457
let next_cmap_events = subscriber
458
- . collect_events ( Duration :: from_millis ( 1000 ) , |event| match event {
459
- Event :: Cmap ( _) => true ,
460
- _ => false ,
458
+ . collect_events ( Duration :: from_millis ( 1000 ) , |event| {
459
+ matches ! ( event, Event :: Cmap ( _) )
461
460
} )
462
461
. await ;
463
462
You can’t perform that action at this time.
0 commit comments