Closed ConnyOnny closed 7 years ago
At "Take Closures" there is this code example:
let res: Result<i32, String> = Err("oh noes"); res.unwrap_or(42) // just returns `42` res.unwrap_or_else(|msg| msg.len() > 12) // will call the closure
I think the > 12 part should be replaced by as i32, because the types i32 and bool don't match, making compilation impossible.
> 12
as i32
i32
bool
Thanks! I'll also change String to &str while I'm at it :)
String
&str
(I should probably run every code block as a doc test…)
At "Take Closures" there is this code example:
I think the
> 12
part should be replaced byas i32
, because the typesi32
andbool
don't match, making compilation impossible.