Skip to content

Commit

Permalink
formatting &c.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa McHale committed Aug 14, 2018
1 parent d9242fd commit e0e513a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
6 changes: 1 addition & 5 deletions benches/bench.rs
Expand Up @@ -121,11 +121,7 @@ fn get_entries_is_file(b: &mut Bencher) {
for p in paths {
let val = p.unwrap();
let t = val.file_type().unwrap();
let _ = if t.is_file() {
true
} else {
t.is_dir()
};
let _ = if t.is_file() { true } else { t.is_dir() };
}
})
}
Expand Down
9 changes: 3 additions & 6 deletions src/types.rs
Expand Up @@ -92,8 +92,7 @@ impl FileTree {
(if dirs_only { a.is_dir } else { true })
&& Some(a.bytes) > min_bytes.map(FileSize::new)
&& (max_depth.is_none() || Some(a.depth) <= max_depth)
})
.take(n)
}).take(n)
.collect::<Vec<NamePair>>();
FileTree {
file_size: self_size,
Expand All @@ -110,8 +109,7 @@ impl FileTree {
(if dirs_only { a.is_dir } else { true })
&& Some(a.bytes) > min_bytes.map(FileSize::new)
&& (max_depth.is_none() || Some(a.depth) <= max_depth)
})
.collect::<Vec<NamePair>>();
}).collect::<Vec<NamePair>>();
FileTree {
file_size: self_size,
files: new,
Expand All @@ -138,8 +136,7 @@ impl FileTree {
(if dirs_only { a.is_dir } else { true })
&& Some(a.bytes) > min_bytes.map(FileSize::new)
&& (max_depth.is_none() || Some(a.depth) <= max_depth)
})
.collect::<Vec<NamePair>>();
}).collect::<Vec<NamePair>>();

FileTree {
file_size: self_size,
Expand Down
17 changes: 9 additions & 8 deletions src/walk_parallel/mod.rs
Expand Up @@ -327,19 +327,21 @@ pub fn clean_project_dirs<P: AsRef<Path>>(p: P, exclude: &Option<Regex>, _: bool
.clone()
.map(|e| e.is_match(&p.path().to_string_lossy().to_string()))
!= Some(false)
})
.filter(|p| {
}).filter(|p| {
REGEX.is_match(&p.path().to_string_lossy().to_string())
|| is_project_dir(
&p.path().to_string_lossy().to_string(),
&p.path()
.file_name()
.map(|x| x.to_string_lossy().to_string())
.unwrap_or_else(|| "".to_string()),
) || latex_log(&p.path()) || ats_cgen(p.path().file_name()) || ({
let x = &p.path().to_string_lossy().to_string();
x.ends_with("/flxg_stats.txt")
})
)
|| latex_log(&p.path())
|| ats_cgen(p.path().file_name())
|| ({
let x = &p.path().to_string_lossy().to_string();
x.ends_with("/flxg_stats.txt")
})
}) {
if dir.file_type().is_file() {
fs::remove_file(dir.path()).unwrap_or(());
Expand Down Expand Up @@ -425,8 +427,7 @@ pub fn print_parallel(w: Walk) -> () {
} else if let Err(e) = result {
panic!("{:?}", e)
}
})
.count();
}).count();

// get the total size
let m = arc.load(Ordering::SeqCst); // TODO - check if this works with Relaxed?
Expand Down

0 comments on commit e0e513a

Please sign in to comment.