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
55source ./.evergreen/env.sh
66
77# 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
99
1010rustup install $CLIPPY_VERSION
1111
1212# Check with default features.
1313cargo +$CLIPPY_VERSION clippy --all-targets -p mongodb -- -D warnings
1414
1515# 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 {
279279 self . idp_server_info = idp_server_info;
280280 }
281281 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 ) ;
283283 self . last_call_time = Instant :: now ( ) ;
284284 self . token_gen_id += 1 ;
285285 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl Action for ParseConnectionString {
2121 let mut options = ClientOptions :: from_connection_string ( conn_str) ;
2222 #[ cfg( feature = "dns-resolver" ) ]
2323 {
24- options. resolver_config = self . resolver_config . clone ( ) ;
24+ options. resolver_config . clone_from ( & self . resolver_config ) ;
2525 }
2626
2727 let resolved = host_info. resolve ( self . resolver_config ) . await ?;
Original file line number Diff line number Diff line change 44#![ warn( clippy:: cast_possible_truncation) ]
55#![ warn( clippy:: cast_possible_wrap) ]
66#![ cfg_attr(
7- feature = "cargo- clippy" ,
7+ feature = "clippy" ,
88 allow(
99 clippy:: unreadable_literal,
1010 clippy:: cognitive_complexity,
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ impl TopologyDescription {
175175 }
176176
177177 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 ) ;
179179 self . local_threshold = options. local_threshold ;
180180 self . heartbeat_freq = options. heartbeat_freq ;
181181 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(
4343 new_hosts : Result < Vec < ServerAddress > > ,
4444) -> HashSet < ServerAddress > {
4545 let mut options = ClientOptions :: new_srv ( ) ;
46- options. hosts = DEFAULT_HOSTS . clone ( ) ;
46+ options. hosts . clone_from ( & DEFAULT_HOSTS ) ;
4747 options. test_options_mut ( ) . disable_monitoring_threads = true ;
4848 options. srv_max_hosts = max_hosts;
4949 let mut topology = Topology :: new ( options. clone ( ) ) . unwrap ( ) ;
@@ -132,7 +132,7 @@ async fn load_balanced_no_srv_polling() {
132132 let hosts = vec ! [ localhost_test_build_10gen( 27017 ) ] ;
133133 let mut options = ClientOptions :: new_srv ( ) ;
134134 let rescan_interval = options. original_srv_info . as_ref ( ) . cloned ( ) . unwrap ( ) . min_ttl ;
135- options. hosts = hosts . clone ( ) ;
135+ options. hosts . clone_from ( & hosts ) ;
136136 options. load_balanced = Some ( true ) ;
137137 options. test_options_mut ( ) . mock_lookup_hosts = Some ( make_lookup_hosts ( vec ! [
138138 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
114114
115115pub ( crate ) fn update_options_for_testing ( options : & mut ClientOptions ) {
116116 if options. server_api . is_none ( ) {
117- options. server_api = SERVER_API . clone ( ) ;
117+ options. server_api . clone_from ( & SERVER_API ) ;
118118 }
119119
120120 #[ cfg( any(
Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ async fn run_test(mut test_file: TestFile) {
135135 } else {
136136 let mut options_with_tls = options. clone ( ) ;
137137 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 ) ;
139141 }
140142
141143 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() {
138138 . expect ( "pool clear should occur" ) ;
139139
140140 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 ( _) )
144143 } )
145144 . await ;
146145
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ async fn run_legacy() {
4949 continue ;
5050 }
5151 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 ) ;
5353 if options. heartbeat_freq . is_none ( ) {
5454 options. heartbeat_freq = Some ( MIN_HEARTBEAT_FREQUENCY ) ;
5555 }
@@ -455,9 +455,8 @@ async fn retry_write_pool_cleared() {
455455 . expect ( "pool clear should occur" ) ;
456456
457457 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 ( _) )
461460 } )
462461 . await ;
463462
You can’t perform that action at this time.
0 commit comments