fix more clippy warnings

This commit is contained in:
Lireer 2020-10-10 18:13:14 +02:00
parent 2911282c36
commit 0820cc4fe2
2 changed files with 3 additions and 7 deletions

View file

@ -1112,9 +1112,8 @@ mod test {
v.extend_from_slice(include_bytes!("../tests/data/mimetype.zip"));
let mut reader = io::Cursor::new(v);
loop {
match read_zipfile_from_stream(&mut reader).unwrap() {
None => break,
_ => (),
if read_zipfile_from_stream(&mut reader).unwrap().is_none() {
break;
}
}
}

View file

@ -273,10 +273,7 @@ impl ZipFileData {
::std::path::Path::new(&filename)
.components()
.filter(|component| match *component {
::std::path::Component::Normal(..) => true,
_ => false,
})
.filter(|component| matches!(*component, ::std::path::Component::Normal(..)))
.fold(::std::path::PathBuf::new(), |mut path, ref cur| {
path.push(cur.as_os_str());
path