about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-03 21:26:15 +0100
committerGitHub <noreply@github.com>2020-03-03 21:26:15 +0100
commit099cd7f402dd2ccec7f35c13c585c650243d018c (patch)
tree24c38ef61eac44bddea2283d9d87479deb4ef558
parent8ca3e59f8a768f9d246b69f629097a83af297fa1 (diff)
parentdf716b0e37ed087b8bce20bc04c23efd0fa5b645 (diff)
downloadrust-099cd7f402dd2ccec7f35c13c585c650243d018c.tar.gz
rust-099cd7f402dd2ccec7f35c13c585c650243d018c.zip
Rollup merge of #69653 - matthiaskrgr:needless_bool, r=Dylan-DPC
use conditions directly
-rw-r--r--src/librustc_codegen_llvm/va_arg.rs3
-rw-r--r--src/librustc_span/source_map.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/va_arg.rs b/src/librustc_codegen_llvm/va_arg.rs
index 9bc3eec60ae..a552f2cdb78 100644
--- a/src/librustc_codegen_llvm/va_arg.rs
+++ b/src/librustc_codegen_llvm/va_arg.rs
@@ -117,8 +117,7 @@ pub(super) fn emit_va_arg(
         // Windows x86_64
         ("x86_64", true) => {
             let target_ty_size = bx.cx.size_of(target_ty).bytes();
-            let indirect =
-                if target_ty_size > 8 || !target_ty_size.is_power_of_two() { true } else { false };
+            let indirect: bool = target_ty_size > 8 || !target_ty_size.is_power_of_two();
             emit_ptr_va_arg(bx, addr, target_ty, indirect, Align::from_bytes(8).unwrap(), false)
         }
         // For all other architecture/OS combinations fall back to using
diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs
index 39601ad7622..e0bbaf730a5 100644
--- a/src/librustc_span/source_map.rs
+++ b/src/librustc_span/source_map.rs
@@ -689,7 +689,7 @@ impl SourceMap {
                 whitespace_found = true;
             }
 
-            if whitespace_found && !c.is_whitespace() { false } else { true }
+            !whitespace_found || c.is_whitespace()
         })
     }