2 ms·
The issue here is that None => None is really a code smell, because all you are doing is mapping the internal value of Some(..). Hence, calling .map() actually
by nextaccountic 5y ago
The issue here is that None => None is really a code smell, because all you are doing is mapping the internal value of Some(..).
Hence, calling .map() actually makes the intent of the code more clear.
- jkelleyrtp 5y agoIn some cases I've found it impossible to use .map() - especially when needing to use "self" and dealing with lifetimes of data borrowed from "self". I really wish Rust had proper disjoint capture for private methods in these instances.
- NobodyNada 5y agoDisjoint capture in closures is coming in Rust 2021 next month: https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-c...