It can be bad practice to use unwrap as is panics on failure. There are several places where the code should warn but not panic. In other places a more descriptive panic method may be necessary.
Currently there are 26 invocations of .unwrap()
main.rs:343: let mut img = image::open(&Path::new(&path)).unwrap();
main.rs:701: ).unwrap();
main.rs:731: ).unwrap();
main.rs:762: ).unwrap();
main.rs:793: ).unwrap();
main.rs:803: ).unwrap();
main.rs:820: ).unwrap();
main.rs:825: ).unwrap();
main.rs:830: ).unwrap();
main.rs:838: ).unwrap();
main.rs:846: ).unwrap();
main.rs:854: ).unwrap();
main.rs:869: let f = (File::open(IMPORTED)).unwrap();
main.rs:872: let templ = line.unwrap();
main.rs:895: let start = numbers[0].parse::<usize>().unwrap();
main.rs:896: let end = numbers[1].parse::<usize>().unwrap();
main.rs:901: let i = sel.to_string().parse::<usize>().unwrap();
main.rs:907: let paths = fs::read_dir("./").unwrap();
main.rs:912: let path = p.unwrap().path();
main.rs:916: path.extension().unwrap() == "png" ||
main.rs:917: path.extension().unwrap() == "jpg" ||
main.rs:918: path.extension().unwrap() == "bpm" ||
main.rs:919: path.extension().unwrap() == "gif"
main.rs:921: mpaths.push(path.into_os_string().into_string().unwrap());//ugly hack but as_path().to_string() does not work
main.rs:1119: File::create(IMPORTED).unwrap();
main.rs:1125: .unwrap();
It can be bad practice to use
unwrapas is panics on failure. There are several places where the code should warn but not panic. In other places a more descriptive panic method may be necessary.Currently there are 26 invocations of
.unwrap()