What changed, and why it matters
This is an automated code-formatting commit from rustfmt. It only changes whitespace, line breaks, and adds a missing semicolon after a return statement. There is no functional change and no security relevance.
No action needed; this is a cosmetic formatting change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit applies rustfmt nightly formatting to two files. In hashes/src/internal_macros.rs it adds a semicolon after return ... copy_from_slice(&inp) and adjusts spacing around operators. In primitives/src/witness.rs it reformats a long chain of saturating_add calls across multiple lines. No logic, API, or behavior changes are present.
Changed components
hashes/src/internal_macros.rsprimitives/src/witness.rsInspect captured patch +7 / −4
diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs
index f77eb36b..b8387ee9 100644
--- a/hashes/src/internal_macros.rs
+++ b/hashes/src/internal_macros.rs
@@ -207,14 +207,14 @@ macro_rules! impl_engine_input {
// we know we won't complete a block, so just copy into the buffer and return
if buf_idx + inp.len() < block_size {
- return self.buffer[buf_idx..buf_idx + inp.len()].copy_from_slice(&inp)
+ return self.buffer[buf_idx..buf_idx + inp.len()].copy_from_slice(&inp);
}
// we'll process at least one block.
// if there's a partial buffer, complete it and process it
if buf_idx > 0 {
let needed = block_size - buf_idx;
- self.buffer[buf_idx..buf_idx+needed].copy_from_slice(&inp[..needed]);
+ self.buffer[buf_idx..buf_idx + needed].copy_from_slice(&inp[..needed]);
Self::process_blocks(&mut self.h, &self.buffer);
inp = &inp[needed..]
}
@@ -236,6 +236,6 @@ macro_rules! impl_engine_input {
}
self.bytes_hashed += inp.len() as u64;
}
- }
+ };
}
pub(crate) use impl_engine_input;
diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs
index 9f9db89e..b3c775f3 100644
--- a/primitives/src/witness.rs
+++ b/primitives/src/witness.rs
@@ -468,7 +468,10 @@ impl encoding::Decoder for WitnessDecoder {
// Re-encode the length back into the buffer.
let encoded_size = CompactSizeEncoder::encoded_size(element_length);
- let required_len = self.cursor.saturating_add(encoded_size).saturating_add(element_length.min(MIN_VECTOR_ALLOCATE));
+ let required_len = self
+ .cursor
+ .saturating_add(encoded_size)
+ .saturating_add(element_length.min(MIN_VECTOR_ALLOCATE));
self.reserve_batch(required_len);
let encoded_compact_size = crate::compact_size_encode(element_length);
self.content[self.cursor..self.cursor + encoded_size]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.