Skip to content

Commit e34927e

Browse files
committed
add multi-line test case
1 parent 7605bac commit e34927e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/ui/option_map_or_none.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ fn main() {
1616
});
1717
// function returning `Option`
1818
let _: Option<i32> = opt.map_or(None, bar);
19+
let _: Option<i32> = opt.map_or(None, |x| {
20+
let offset = 0;
21+
let height = 1;
22+
Some(offset + height)
23+
});
1924
}

0 commit comments

Comments
 (0)