fix clippy warnings

This commit is contained in:
Gabriel B Gutierrez 2021-10-15 12:12:17 -03:00
parent 28b26ca44d
commit 5bd20e4d36
3 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ impl Command for Cp {
sources.remove(index); sources.remove(index);
} }
if sources.len() == 0 { if sources.is_empty() {
return Err(ShellError::NoFileToBeCopied()); return Err(ShellError::NoFileToBeCopied());
} }
} }

View file

@ -87,7 +87,7 @@ impl Command for Mv {
sources.remove(index); sources.remove(index);
} }
if sources.len() == 0 { if sources.is_empty() {
return Err(ShellError::NoFileToBeMoved()); return Err(ShellError::NoFileToBeMoved());
} }
} }

View file

@ -147,7 +147,7 @@ fn rm(context: &EvaluationContext, call: &Call) -> Result<Value, ShellError> {
targets.remove(index); targets.remove(index);
} }
if targets.len() == 0 { if targets.is_empty() {
return Err(ShellError::NoFileToBeRemoved()); return Err(ShellError::NoFileToBeRemoved());
} }
} }