We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2776076 commit abb7155Copy full SHA for abb7155
tests/ui/option_map_or_none.rs
@@ -4,6 +4,7 @@
4
5
fn main() {
6
let opt = Some(1);
7
+ let r: Result<i32, i32> = Ok(1);
8
let bar = |_| Some(1);
9
10
// Check `OPTION_MAP_OR_NONE`.
@@ -21,4 +22,7 @@ fn main() {
21
22
let height = x;
23
Some(offset + height)
24
});
25
+
26
+ // Check `RESULT_MAP_OR_INTO_OPTION`.
27
+ let _: Option<i32> = r.map_or(None, Some);
28
}
0 commit comments