3 ms·
`extension()` gives you an `Option`, remember `Path` might not be a file or file could be without extension. Why not `((path.extension() == Some("bundle"))`? I
by 0x457 4y ago
`extension()` gives you an `Option`, remember `Path` might not be a file or file could be without extension.
Why not `((path.extension() == Some("bundle"))`? I don't know, it didn't work, and I didn't want to spend too much time on it.
`read_dir` gives us an iterator over `Result<DirEntry>`, so `e` in that map is a `Result` and not a `DirEntry`. It's two different "map" functions - on Option<T> and Result<T,E> it maps "T", but on Iterator it maps "Item" from that iterator.
Here is an explanation why `read_dir` give you a Result - https://doc.rust-lang.org/std/fs/fn.read_dir.html#errors https://doc.rust-lang.org/std/fs/fn.read_dir.html#errors
- Already__Taken 4y agoThanks for the insight