diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-04 15:53:14 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-04 20:41:03 +0100 |
| commit | d8d2004c6ffb8b66eac90e75aa23012130adf9f9 (patch) | |
| tree | 3f827a8f9ab5363f24cc85cecc91a8318551cbf3 /src/librustc_errors | |
| parent | 38f5db72681289f6ebbcb3c89081f021aa6fdc63 (diff) | |
Don't use "if let" bindings to only check a value and not actually bind anything.
For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 5b00087de6f..f0e388a597b 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -163,7 +163,7 @@ impl CodeSuggestion { None => buf.push_str(&line[lo..]), } } - if let None = hi_opt { + if hi_opt.is_none() { buf.push('\n'); } } |
