]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/option_map_or_none.fixed
Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / option_map_or_none.fixed
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.and_then(|x| Some(x + 1));
11     // Multi-line case.
12     #[rustfmt::skip]
13     let _ = opt.and_then(|x| {
14                         Some(x + 1)
15                        });
16 }