]> git.lizzy.rs Git - rust.git/blob - tests/ui/option_map_or_none.rs
Auto merge of #3978 - phansch:rustfix_len_zero, r=flip1995
[rust.git] / tests / ui / option_map_or_none.rs
1 // run-rustfix
2
3 fn main() {
4     let opt = Some(1);
5
6     // Check `OPTION_MAP_OR_NONE`.
7     // Single line case.
8     let _ = opt.map_or(None, |x| Some(x + 1));
9     // Multi-line case.
10     #[rustfmt::skip]
11     let _ = opt.map_or(None, |x| {
12                         Some(x + 1)
13                        });
14 }