2019-04-18 08:12:59 +02:00
|
|
|
// run-rustfix
|
|
|
|
|
2019-08-16 04:42:07 +02:00
|
|
|
#![allow(clippy::option_and_then_some)]
|
|
|
|
|
2019-04-18 08:12:59 +02:00
|
|
|
fn main() {
|
|
|
|
let opt = Some(1);
|
|
|
|
|
|
|
|
// Check `OPTION_MAP_OR_NONE`.
|
|
|
|
// Single line case.
|
|
|
|
let _ = opt.and_then(|x| Some(x + 1));
|
|
|
|
// Multi-line case.
|
|
|
|
#[rustfmt::skip]
|
|
|
|
let _ = opt.and_then(|x| {
|
|
|
|
Some(x + 1)
|
|
|
|
});
|
|
|
|
}
|