2019-04-18 01:12:59 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
2020-04-25 15:33:11 -05:00
|
|
|
#![allow(clippy::bind_instead_of_map)]
|
2019-08-15 21:42:07 -05:00
|
|
|
|
2019-04-18 01:12:59 -05: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)
|
|
|
|
});
|
|
|
|
}
|