From 5d8a7106103be5d166857302ec627b740a209bb7 Mon Sep 17 00:00:00 2001 From: wakiyamap Date: Fri, 28 Jun 2024 21:49:09 +0900 Subject: [PATCH] Fix lint --- src/bmw/mod.rs | 2 +- src/lyra2.rs | 2 +- src/lyra2mod/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bmw/mod.rs b/src/bmw/mod.rs index 2c24d5e..32ad9d7 100644 --- a/src/bmw/mod.rs +++ b/src/bmw/mod.rs @@ -936,7 +936,7 @@ pub fn sum(input: Vec) -> Vec { buf.push(0); } } - buf[input.len() as usize] = 0x80; + buf[input.len()] = 0x80; let bit_len = ((input.len() as u64) << 3).to_le_bytes(); buf[56] = bit_len[0]; buf[57] = bit_len[1]; diff --git a/src/lyra2.rs b/src/lyra2.rs index c6c0000..17526e7 100644 --- a/src/lyra2.rs +++ b/src/lyra2.rs @@ -271,7 +271,7 @@ pub fn lyra2( let row_len_int64: i64 = BLOCKLENINT64 * n_cols as i64; let mut _i: i64 = n_rows as i64 * row_len_int64; - let mut whole_matrix: Vec = Vec::new(); + let mut whole_matrix: Vec = vec![0; _i as usize]; whole_matrix.resize(_i as usize, 0); //==========================================================================/ diff --git a/src/lyra2mod/mod.rs b/src/lyra2mod/mod.rs index f0dc5b4..a50b7d3 100644 --- a/src/lyra2mod/mod.rs +++ b/src/lyra2mod/mod.rs @@ -248,7 +248,7 @@ pub fn lyra2mod( let row_len_int64: i64 = BLOCKLENINT64 * n_cols as i64; let mut _i: i64 = n_rows as i64 * row_len_int64; - let mut whole_matrix: Vec = Vec::new(); + let mut whole_matrix: Vec = vec![0; _i as usize]; whole_matrix.resize(_i as usize, 0); //==========================================================================/