File tree 2 files changed +7
-13
lines changed
2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 2
2
/// The lints included in `option_methods()` should not lint if the call to map is partially
3
3
/// within a macro
4
4
macro_rules! opt_map {
5
- ( $opt: expr, $map: expr) => { ( $opt) . map( $map) } ;
5
+ ( $opt: expr, $map: expr) => {
6
+ ( $opt) . map( $map)
7
+ } ;
6
8
}
7
9
8
10
/// Struct to generate false positive for Iterator-based lints
Original file line number Diff line number Diff line change @@ -18,18 +18,10 @@ fn result_methods() {
18
18
19
19
// Check RESULT_MAP_UNWRAP_OR_ELSE
20
20
// 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 ) ;
33
25
// macro case
34
26
let _ = opt_map ! ( res, |x| x + 1 ) . unwrap_or_else ( |e| 0 ) ; // should not lint
35
27
}
You can’t perform that action at this time.
0 commit comments