]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/option_map_or_none.rs
Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'
[rust.git] / src / tools / clippy / tests / ui / option_map_or_none.rs
1 // run-rustfix
2
3 #![allow(clippy::option_and_then_some)]
4
5 fn main() {
6     let opt = Some(1);
7
8     // Check `OPTION_MAP_OR_NONE`.
9     // Single line case.
10     let _ = opt.map_or(None, |x| Some(x + 1));
11     // Multi-line case.
12     #[rustfmt::skip]
13     let _ = opt.map_or(None, |x| {
14                         Some(x + 1)
15                        });
16 }