chore: fix some typos in comment

Signed-off-by: todaymoon <csgcgl@foxmail.com>
This commit is contained in:
todaymoon 2025-03-26 21:03:03 +08:00
parent 143531de7c
commit 2867a7074f
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ mod fast_hash {
} }
impl Midstate { impl Midstate {
#[allow(clippy::identity_op)] // more readble #[allow(clippy::identity_op)] // more readable
const fn read_u32(bytes: &[u8], index: usize) -> u32 { const fn read_u32(bytes: &[u8], index: usize) -> u32 {
((bytes[index + 0] as u32) << 24) ((bytes[index + 0] as u32) << 24)
| ((bytes[index + 1] as u32) << 16) | ((bytes[index + 1] as u32) << 16)
@ -130,7 +130,7 @@ impl Midstate {
if (bytes.len() % 64 <= 64 - 9) || (chunk + 2 == num_chunks) { if (bytes.len() % 64 <= 64 - 9) || (chunk + 2 == num_chunks) {
buf[i] = 0x80; buf[i] = 0x80;
} }
#[allow(clippy::identity_op)] // more readble #[allow(clippy::identity_op)] // more readable
#[allow(clippy::erasing_op)] #[allow(clippy::erasing_op)]
if chunk + 1 == num_chunks { if chunk + 1 == num_chunks {
let bit_len = bytes.len() as u64 * 8; let bit_len = bytes.len() as u64 * 8;
@ -235,7 +235,7 @@ impl Midstate {
} }
let mut output = [0u8; 32]; let mut output = [0u8; 32];
let mut i = 0; let mut i = 0;
#[allow(clippy::identity_op)] // more readble #[allow(clippy::identity_op)] // more readable
while i < 8 { while i < 8 {
output[i * 4 + 0] = (state[i + 0] >> 24) as u8; output[i * 4 + 0] = (state[i + 0] >> 24) as u8;
output[i * 4 + 1] = (state[i + 0] >> 16) as u8; output[i * 4 + 1] = (state[i + 0] >> 16) as u8;

View File

@ -8,7 +8,7 @@ macro_rules! const_assert {
($x:expr $(; $message:expr)?) => { ($x:expr $(; $message:expr)?) => {
const _: () = { const _: () = {
if !$x { if !$x {
// We can't use formatting in const, only concating literals. // We can't use formatting in const, only concatenating literals.
panic!(concat!("assertion ", stringify!($x), " failed" $(, ": ", $message)?)) panic!(concat!("assertion ", stringify!($x), " failed" $(, ": ", $message)?))
} }
}; };