Slide 45
Slide 45 text
45
Other Combinator Methods (2)
Map an Option to Option or U.
Option.map(self, f: F) -> Option
where F: FnOnce(T) -> U
Option.map_or(self, default: U, f: F) -> U
where F: FnOnce(T) -> U
Option.map_or_else(self, default: D, f: F)
-> U
where F: FnOnce(T) -> U, D: FnOnce() -> U