simplify filename filter

This commit is contained in:
Dmitry Belyaev 2023-08-01 17:12:23 +03:00
parent 130e5ee2aa
commit 65c64f17d7
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -278,11 +278,8 @@ async fn zip_text_reader(tx: UnboundedSender<TextReaderMessage>) {
.iter()
.enumerate()
.filter(|(_, entry)| !entry.dir().unwrap_or(true))
.filter(|(_, entry)| {
// skip files without "txt" extension
entry.filename().as_str().unwrap().ends_with(".txt")
})
.map(|(index, entry)| (index, entry.filename().as_str().unwrap().to_string()))
.filter(|(_, filename)| filename.ends_with(".txt"))
.collect();
//
drop(archive);