File tree Expand file tree Collapse file tree 9 files changed +9
-38
lines changed Expand file tree Collapse file tree 9 files changed +9
-38
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ struct State {
7
7
is_doing : String ,
8
8
flag : bool ,
9
9
}
10
- #[ derive( Debug , serde:: Serialize ) ]
11
- struct State2 {
12
- is_doing : String ,
13
- business : String ,
14
- }
15
10
16
11
#[ tokio:: main]
17
12
async fn main ( ) -> Result < ( ) , Box < dyn snafu:: Error > > {
Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ where
159
159
mod should {
160
160
use super :: * ;
161
161
use crate :: core:: event_engine:: Event ;
162
- use std:: future:: Future ;
163
162
164
163
struct TestEvent ;
165
164
@@ -261,27 +260,6 @@ mod should {
261
260
}
262
261
}
263
262
264
- #[ derive( Clone ) ]
265
- struct TestRuntime { }
266
-
267
- #[ async_trait:: async_trait]
268
- impl Runtime for TestRuntime {
269
- fn spawn < R > ( & self , _future : impl Future < Output = R > + Send + ' static )
270
- where
271
- R : Send + ' static ,
272
- {
273
- // Do nothing.
274
- }
275
-
276
- async fn sleep ( self , _delay : u64 ) {
277
- // Do nothing.
278
- }
279
-
280
- async fn sleep_microseconds ( self , _delay : u64 ) {
281
- // Do nothing.
282
- }
283
- }
284
-
285
263
#[ test]
286
264
fn create_not_managed_effect ( ) {
287
265
let ( _tx, rx) = async_channel:: bounded :: < TestInvocation > ( 5 ) ;
Original file line number Diff line number Diff line change @@ -304,9 +304,7 @@ impl RequestRetryConfiguration {
304
304
/// * `Some(delay_in_microseconds)` - The delay in microseconds.
305
305
/// * `None` - If `delay_in_seconds` is `None`.
306
306
fn delay_in_microseconds ( delay_in_seconds : Option < u64 > ) -> Option < u64 > {
307
- let Some ( delay_in_seconds) = delay_in_seconds else {
308
- return None ;
309
- } ;
307
+ let delay_in_seconds = delay_in_seconds?;
310
308
311
309
const MICROS_IN_SECOND : u64 = 1_000_000 ;
312
310
let delay = delay_in_seconds * MICROS_IN_SECOND ;
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ mod it_should {
350
350
response : None ,
351
351
request_handler : Some ( Box :: new ( |req| {
352
352
assert ! ( req. query_parameters. contains_key( "timestamp" ) ) ;
353
- assert ! ( req. query_parameters. get ( "timestamp" ) . is_some ( ) ) ;
353
+ assert ! ( req. query_parameters. contains_key ( "timestamp" ) ) ;
354
354
} ) ) ,
355
355
} ;
356
356
@@ -368,7 +368,7 @@ mod it_should {
368
368
response : None ,
369
369
request_handler : Some ( Box :: new ( |req| {
370
370
assert ! ( req. query_parameters. contains_key( "signature" ) ) ;
371
- assert ! ( req. query_parameters. get ( "signature" ) . is_some ( ) ) ;
371
+ assert ! ( req. query_parameters. contains_key ( "signature" ) ) ;
372
372
assert ! ( req
373
373
. query_parameters
374
374
. get( "signature" )
Original file line number Diff line number Diff line change @@ -840,7 +840,7 @@ mod it_should {
840
840
response : None ,
841
841
request_handler : Some ( Box :: new ( |req| {
842
842
assert ! ( req. query_parameters. contains_key( "state" ) ) ;
843
- assert ! ( req. query_parameters. get ( "state" ) . is_some ( ) ) ;
843
+ assert ! ( req. query_parameters. contains_key ( "state" ) ) ;
844
844
845
845
let state = req. query_parameters . get ( "state" ) . unwrap ( ) ;
846
846
assert ! ( state. contains( "channel_a" ) ) ;
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ impl SubscribeState {
329
329
// Merge stored cursor with service-provided.
330
330
let mut next_cursor = next_cursor. clone ( ) ;
331
331
if let Some ( cursor) = cursor {
332
- next_cursor. timetoken = cursor. timetoken . clone ( ) ;
332
+ next_cursor. timetoken . clone_from ( & cursor. timetoken ) ;
333
333
}
334
334
335
335
Some ( self . transition_to (
Original file line number Diff line number Diff line change @@ -537,7 +537,7 @@ where
537
537
. gt ( current_cursor)
538
538
. then ( || * cursor_slot = Some ( catchup_cursor) ) ;
539
539
} else {
540
- * cursor_slot = cursor . clone ( ) ;
540
+ cursor_slot. clone_from ( & cursor ) ;
541
541
}
542
542
}
543
543
}
Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ where
346
346
if !event_handlers. is_empty ( ) {
347
347
if let Some ( ( _, handler) ) = event_handlers. iter ( ) . next ( ) {
348
348
if let Some ( handler) = handler. upgrade ( ) . clone ( ) {
349
- client = handler. client ( ) . upgrade ( ) . clone ( ) ;
349
+ client. clone_from ( & handler. client ( ) . upgrade ( ) ) ;
350
350
}
351
351
}
352
352
}
Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ where
903
903
. gt ( current_cursor)
904
904
. then ( || * cursor_slot = Some ( catchup_cursor) ) ;
905
905
} else {
906
- * cursor_slot = cursor . clone ( ) ;
906
+ cursor_slot. clone_from ( & cursor ) ;
907
907
}
908
908
}
909
909
}
@@ -1174,7 +1174,7 @@ mod it_should {
1174
1174
. into_iter ( )
1175
1175
. map ( |name| client. channel ( name) . subscription ( None ) )
1176
1176
. collect :: < Vec < Subscription < _ , _ > > > ( ) ;
1177
- let channels_3_subscriptions = vec ! [
1177
+ let channels_3_subscriptions = [
1178
1178
channels_1_subscriptions[ 0 ] . clone ( ) ,
1179
1179
channels_2_subscriptions[ 1 ] . clone ( ) ,
1180
1180
] ;
You can’t perform that action at this time.
0 commit comments