Open
Description
On the page Option Result, the last example doesn't really have an explanation for the new combinators introduced. Namely, map_or
.
Also, within the map_or
, there is a closure function with no real explanation either.
|r| r.map(Some)
I don't really understand what is going on here.
The main line that needs explanation is
let opt = opt.map_or(Ok(None), |r| r.map(Some))?;
Like, what exactly is happening here? I've been staring at it for about 15 minutes, but I can't figure it out.