Assign const to number of lines printed by inspect

This commit is contained in:
Kevin Liu 2016-10-19 02:32:18 -07:00
parent f3aaa4acde
commit 77d3d1a707

View file

@ -22,6 +22,7 @@ use std::os::unix::fs::PermissionsExt;
static GRAVEYARD: &'static str = "/tmp/.graveyard";
static RECORD: &'static str = ".record";
const LINES_TO_INSPECT: usize = 6;
fn main() {
let matches = App::new("rip")
@ -142,7 +143,7 @@ Send files to the graveyard (/tmp/.graveyard) instead of unlinking them.")
let f = fs::File::open(target).unwrap();
for line in BufReader::new(f)
.lines()
.take(6)
.take(LINES_TO_INSPECT)
.filter(|line| line.is_ok()) {
println!("> {}", line.unwrap());
}