about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 15:53:14 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 20:41:03 +0100
commitd8d2004c6ffb8b66eac90e75aa23012130adf9f9 (patch)
tree3f827a8f9ab5363f24cc85cecc91a8318551cbf3 /src/librustc_codegen_llvm/back
parent38f5db72681289f6ebbcb3c89081f021aa6fdc63 (diff)
downloadrust-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.rs2
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;
                     }