add test case for result_map_or_into_option

This commit is contained in:
togami2864 2021-11-19 16:12:46 +09:00
parent 2776076efa
commit abb7155387

View file

@ -4,6 +4,7 @@
fn main() {
let opt = Some(1);
let r: Result<i32, i32> = Ok(1);
let bar = |_| Some(1);
// Check `OPTION_MAP_OR_NONE`.
@ -21,4 +22,7 @@ fn main() {
let height = x;
Some(offset + height)
});
// Check `RESULT_MAP_OR_INTO_OPTION`.
let _: Option<i32> = r.map_or(None, Some);
}