rustfmt
This commit is contained in:
parent
0c54913afe
commit
c84a894ed7
2 changed files with 7 additions and 13 deletions
|
|
@ -2,7 +2,9 @@
|
|||
/// The lints included in `option_methods()` should not lint if the call to map is partially
|
||||
/// within a macro
|
||||
macro_rules! opt_map {
|
||||
($opt:expr, $map:expr) => {($opt).map($map)};
|
||||
($opt:expr, $map:expr) => {
|
||||
($opt).map($map)
|
||||
};
|
||||
}
|
||||
|
||||
/// Struct to generate false positive for Iterator-based lints
|
||||
|
|
|
|||
|
|
@ -18,18 +18,10 @@ fn result_methods() {
|
|||
|
||||
// Check RESULT_MAP_UNWRAP_OR_ELSE
|
||||
// single line case
|
||||
let _ = res.map(|x| x + 1)
|
||||
|
||||
.unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
|
||||
// multi line cases
|
||||
let _ = res.map(|x| {
|
||||
x + 1
|
||||
}
|
||||
).unwrap_or_else(|e| 0);
|
||||
let _ = res.map(|x| x + 1)
|
||||
.unwrap_or_else(|e|
|
||||
0
|
||||
);
|
||||
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
|
||||
// multi line cases
|
||||
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
|
||||
let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
|
||||
// macro case
|
||||
let _ = opt_map!(res, |x| x + 1).unwrap_or_else(|e| 0); // should not lint
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue