From 0820cc4fe2db48fd87686cffc342ebbd01ba3e81 Mon Sep 17 00:00:00 2001 From: Lireer Date: Sat, 10 Oct 2020 18:13:14 +0200 Subject: [PATCH] fix more clippy warnings --- src/read.rs | 5 ++--- src/types.rs | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/read.rs b/src/read.rs index f837e971..a048c3b3 100644 --- a/src/read.rs +++ b/src/read.rs @@ -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; } } } diff --git a/src/types.rs b/src/types.rs index 9d9371bc..23dfffb8 100644 --- a/src/types.rs +++ b/src/types.rs @@ -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