From 29048b105e5cd86341289de11cb9daa014fe8ac8 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Thu, 24 Feb 2022 20:34:23 -0500 Subject: [PATCH] Fix needless_late_init Clippy warning --- common/src/cmp.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/src/cmp.rs b/common/src/cmp.rs index c148305ca..d182340a9 100644 --- a/common/src/cmp.rs +++ b/common/src/cmp.rs @@ -15,15 +15,11 @@ pub fn timing_safe_cmp(a: &[u8], b: &[u8]) -> bool { * chance to optimize and fold the code in any way that may change * the timing. */ - let length: Volatile; - let mut left: Volatile<*const u8>; - let mut right: Volatile<*const u8>; let mut result: u8 = 0; - /* loop count depends on length of b */ - length = Volatile::new(len_b); - left = Volatile::new(std::ptr::null()); - right = Volatile::new(b); + let length: Volatile = Volatile::new(len_b); + let mut left: Volatile<*const u8> = Volatile::new(std::ptr::null()); + let mut right: Volatile<*const u8> = Volatile::new(b); /* don't use else here to keep the amount of CPU instructions constant, * volatile forces re-evaluation