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_codegen_llvm/back | |
| parent | 38f5db72681289f6ebbcb3c89081f021aa6fdc63 (diff) | |
| download | rust-d8d2004c6ffb8b66eac90e75aa23012130adf9f9.tar.gz rust-d8d2004c6ffb8b66eac90e75aa23012130adf9f9.zip | |
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_codegen_llvm/back')
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index a215ef81bc9..0c243128104 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -725,7 +725,7 @@ pub(crate) unsafe fn codegen( Err(_) => return 0, }; - if let Err(_) = write!(cursor, "{:#}", demangled) { + if write!(cursor, "{:#}", demangled).is_err() { // Possible only if provided buffer is not big enough return 0; } |
