Skip to content

Commit c84a894

Browse files
committed
rustfmt
1 parent 0c54913 commit c84a894

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

tests/auxiliary/option_helpers.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/// The lints included in `option_methods()` should not lint if the call to map is partially
33
/// within a macro
44
macro_rules! opt_map {
5-
($opt:expr, $map:expr) => {($opt).map($map)};
5+
($opt:expr, $map:expr) => {
6+
($opt).map($map)
7+
};
68
}
79

810
/// Struct to generate false positive for Iterator-based lints

tests/ui/result_map_unwrap_or_else.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,10 @@ fn result_methods() {
1818

1919
// Check RESULT_MAP_UNWRAP_OR_ELSE
2020
// single line case
21-
let _ = res.map(|x| x + 1)
22-
23-
.unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
24-
// multi line cases
25-
let _ = res.map(|x| {
26-
x + 1
27-
}
28-
).unwrap_or_else(|e| 0);
29-
let _ = res.map(|x| x + 1)
30-
.unwrap_or_else(|e|
31-
0
32-
);
21+
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
22+
// multi line cases
23+
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
24+
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
3325
// macro case
3426
let _ = opt_map!(res, |x| x + 1).unwrap_or_else(|e| 0); // should not lint
3527
}

0 commit comments

Comments
 (0)