Skip to content

Commit 29048b1

Browse files
committed
Fix needless_late_init Clippy warning
1 parent 0abcd4c commit 29048b1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

common/src/cmp.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ pub fn timing_safe_cmp(a: &[u8], b: &[u8]) -> bool {
1515
* chance to optimize and fold the code in any way that may change
1616
* the timing.
1717
*/
18-
let length: Volatile<usize>;
19-
let mut left: Volatile<*const u8>;
20-
let mut right: Volatile<*const u8>;
2118
let mut result: u8 = 0;
22-
2319
/* loop count depends on length of b */
24-
length = Volatile::new(len_b);
25-
left = Volatile::new(std::ptr::null());
26-
right = Volatile::new(b);
20+
let length: Volatile<usize> = Volatile::new(len_b);
21+
let mut left: Volatile<*const u8> = Volatile::new(std::ptr::null());
22+
let mut right: Volatile<*const u8> = Volatile::new(b);
2723

2824
/* don't use else here to keep the amount of CPU instructions constant,
2925
* volatile forces re-evaluation

0 commit comments

Comments
 (0)