Use is_empty instead of length > 0 #2

Merged
cameron merged 1 commits from feature/fix-clippy-warning into master 2020-06-17 19:01:39 +00:00

View File

@@ -61,7 +61,7 @@ fn traverse_dir(
if config.use_gitignore { if config.use_gitignore {
let should_ignore = gitignore.iter().find(|&line| path.contains(&line.clone())); let should_ignore = gitignore.iter().find(|&line| path.contains(&line.clone()));
if should_ignore.unwrap_or(&String::from("")).len() > 0 if !should_ignore.unwrap_or(&String::from("")).is_empty()
|| entry.path().to_str().unwrap().contains("/.git") || entry.path().to_str().unwrap().contains("/.git")
{ {
continue; continue;