Function tool::monad::ok
[−]
[src]
pub fn ok<R: Ok>(result: R) -> Option<R::Value>
Converts Result
-like values into Option
s.
use tool::ok; let filtered: Vec<_> = vec![Ok(1), Err("bad")].into_iter().filter_map(ok).collect(); assert_eq!(filtered, vec![1]);Run