@@ -214,7 +214,7 @@ pub fn clean_chargers(conn: &mut PooledConnection<diesel::r2d2::ConnectionManage
214214 . load ( conn)
215215 {
216216 Ok ( users) => {
217- if users. len ( ) == 0 {
217+ if users. is_empty ( ) {
218218 use db_connector:: schema:: chargers:: dsl:: * ;
219219
220220 let _ = diesel:: delete ( chargers. find ( & charger. id ) )
@@ -268,7 +268,7 @@ pub(crate) mod tests {
268268 #[ macro_export]
269269 macro_rules! defer {
270270 ( $e: expr) => {
271- let _scope_call = crate :: tests:: ScopeCall {
271+ let _scope_call = $ crate:: tests:: ScopeCall {
272272 c: || -> ( ) {
273273 $e;
274274 } ,
@@ -292,7 +292,7 @@ pub(crate) mod tests {
292292 pub fn create_test_state (
293293 pool : Option < diesel:: r2d2:: Pool < ConnectionManager < PgConnection > > > ,
294294 ) -> web:: Data < AppState > {
295- let pool = pool. unwrap_or_else ( || db_connector:: test_connection_pool ( ) ) ;
295+ let pool = pool. unwrap_or_else ( db_connector:: test_connection_pool) ;
296296
297297 let state = AppState {
298298 pool : pool. clone ( ) ,
@@ -444,7 +444,7 @@ pub(crate) mod tests {
444444 #[ actix_web:: test]
445445 async fn test_clean_verification_tokens ( ) {
446446 let user_id = uuid:: Uuid :: new_v4 ( ) ;
447- let email = format ! ( "{}@invalid" , user_id. to_string ( ) ) ;
447+ let email = format ! ( "{}@invalid" , user_id) ;
448448 let user = User {
449449 id : user_id,
450450 name : user_id. to_string ( ) ,
@@ -464,7 +464,7 @@ pub(crate) mod tests {
464464 let user2 = User {
465465 id : user2_id,
466466 name : user2_id. to_string ( ) ,
467- email : format ! ( "{}@invalid" , user2_id. to_string ( ) ) ,
467+ email : format ! ( "{}@invalid" , user2_id) ,
468468 login_key : String :: new ( ) ,
469469 email_verified : false ,
470470 secret : Vec :: new ( ) ,
@@ -480,7 +480,7 @@ pub(crate) mod tests {
480480 let user3 = User {
481481 id : user3_id,
482482 name : user3_id. to_string ( ) ,
483- email : format ! ( "{}@invalid" , user3_id. to_string ( ) ) ,
483+ email : format ! ( "{}@invalid" , user3_id) ,
484484 login_key : String :: new ( ) ,
485485 email_verified : true ,
486486 secret : Vec :: new ( ) ,
@@ -496,7 +496,7 @@ pub(crate) mod tests {
496496 let user4 = User {
497497 id : user4_id,
498498 name : user4_id. to_string ( ) ,
499- email : format ! ( "{}@invalid" , user4_id. to_string ( ) ) ,
499+ email : format ! ( "{}@invalid" , user4_id) ,
500500 login_key : String :: new ( ) ,
501501 email_verified : false ,
502502 secret : Vec :: new ( ) ,
@@ -611,8 +611,8 @@ pub(crate) mod tests {
611611 assert ! ( u. iter( ) . any( |u| u. id == user3_id) ) ;
612612 assert ! ( u. iter( ) . any( |u| u. id == user4_id) ) ;
613613
614- let user = u . into_iter ( ) . find ( |u| u . id == user4_id ) . unwrap ( ) ;
615- user
614+
615+ u . into_iter ( ) . find ( |u| u . id == user4_id ) . unwrap ( )
616616 } ;
617617
618618 assert_eq ! ( user. email, email) ;
0 commit comments