simplify filename filter
This commit is contained in:
parent
130e5ee2aa
commit
65c64f17d7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user