Skip to content

Commit

Permalink
refactor: Refactoring a if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bush1D3v committed Jun 8, 2024
1 parent 98d52d0 commit 9c8a637
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/middlewares/email_exists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
4 changes: 2 additions & 2 deletions tests/mocks/functional_tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl FunctionalTester {

let rows = client.query(&stmt, &[]).await.unwrap();

if rows.len() > 0 {
if !rows.is_empty() {
true
} else {
false
Expand Down Expand Up @@ -132,7 +132,7 @@ impl FunctionalTester {

let rows = client.query(&stmt, &[]).await.unwrap();

if rows.len() > 0 {
if !rows.is_empty() {
false
} else {
true
Expand Down

0 comments on commit 9c8a637

Please sign in to comment.