Closed
Description
Rather than having 3 versions of every utility (get, map, chain, etc.), we can have a single by-value version.
Conversion to Option<&T>
and Option<&mut T>
from Option<T>
can be composed with the regular combinators. References are first-class values, so there's no need to have extra methods for them.
map_move(...)
-> map(...)
map(...)
-> as_imm().map(...)
map_mut(...)
-> as_mut().map(...)
map_move_default(...)
-> map_default(...)
map_default(...)
-> as_imm().map_default(...)
map_mut_default(...)
-> as_mut().map_default(...)
and_then(...)
-> and_then(...)
and_then_ref(...)
-> as_imm().and_then(...)
and_then_mut_ref(...)
-> as_mut().and_then(...)
unwrap()
-> unwrap()
get_ref()
-> as_imm().unwrap()
get_mut_ref()
-> as_mut().unwrap()