diff options
| author | Philipp Hansch <dev@phansch.net> | 2019-01-02 08:15:32 +0100 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2019-01-02 08:15:32 +0100 |
| commit | c84a894ed7fa16c13a7e9395b85990cb2dacf71a (patch) | |
| tree | fc3dc1202ac5a315842fc2a8ddcb3cba00a48056 | |
| parent | 0c54913afef6b5ca2e6c037bbbfb25e67f9a560a (diff) | |
| download | rust-c84a894ed7fa16c13a7e9395b85990cb2dacf71a.tar.gz rust-c84a894ed7fa16c13a7e9395b85990cb2dacf71a.zip | |
rustfmt
| -rw-r--r-- | tests/auxiliary/option_helpers.rs | 4 | ||||
| -rw-r--r-- | tests/ui/result_map_unwrap_or_else.rs | 16 |
2 files changed, 7 insertions, 13 deletions
diff --git a/tests/auxiliary/option_helpers.rs b/tests/auxiliary/option_helpers.rs index 1734acfb3a2..add237d6fe0 100644 --- a/tests/auxiliary/option_helpers.rs +++ b/tests/auxiliary/option_helpers.rs @@ -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 diff --git a/tests/ui/result_map_unwrap_or_else.rs b/tests/ui/result_map_unwrap_or_else.rs index 2995babe30c..b3f83239961 100644 --- a/tests/ui/result_map_unwrap_or_else.rs +++ b/tests/ui/result_map_unwrap_or_else.rs @@ -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 } |
