3 ms·
The filter_map explanation is wrong. .ok() converts a result to an Option, not a boolean. Likewise, filter_map expects an option. That's how it can both filter
by isaacg 9y ago
The filter_map explanation is wrong. .ok() converts a result to an Option, not a boolean. Likewise, filter_map expects an option. That's how it can both filter and map.
Docs: https://doc.rust-lang.org/std/result/enum.Result.html#method.ok https://doc.rust-lang.org/std/result/enum.Result.html#method...