]> git.lizzy.rs Git - rust.git/blob - tests/ui/option_map_or_none.fixed
Auto merge of #6298 - JohnTitor:fix-example, r=llogiq
[rust.git] / tests / ui / option_map_or_none.fixed
1 // run-rustfix
2
3 #![allow(clippy::bind_instead_of_map)]
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 }