diff --git a/src/middlewares/email_exists.rs b/src/middlewares/email_exists.rs index 7df796f..64d4ca6 100644 --- a/src/middlewares/email_exists.rs +++ b/src/middlewares/email_exists.rs @@ -37,7 +37,7 @@ pub async fn email_exists<'a>( )) } }; - if rows.len() > 0 { + if !rows.is_empty() { return Err(std::io::Error::new( std::io::ErrorKind::InvalidInput, "Este e-mail já está sendo utilizado por outro usuário.", diff --git a/tests/mocks/functional_tester.rs b/tests/mocks/functional_tester.rs index 688cbbb..40dd144 100644 --- a/tests/mocks/functional_tester.rs +++ b/tests/mocks/functional_tester.rs @@ -86,7 +86,7 @@ impl FunctionalTester { let rows = client.query(&stmt, &[]).await.unwrap(); - if rows.len() > 0 { + if !rows.is_empty() { true } else { false @@ -132,7 +132,7 @@ impl FunctionalTester { let rows = client.query(&stmt, &[]).await.unwrap(); - if rows.len() > 0 { + if !rows.is_empty() { false } else { true