What changed, and why it matters
This is a tiny code cleanup change inside unit tests. It replaces `alloc::format!` with the shorter `format!` because the macro is already available in the test module. There is no functional change and no security relevance.
No security action needed. This is a benign refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In primitives/src/script/tests.rs, two test functions (script_to_hex and script_buf_to_hex) are updated to call format! directly instead of alloc::format!. The format! macro is already in scope in the test context, so this is purely a stylistic simplification. The generated code and behavior are identical.
Changed components
primitives/src/script/tests.rsInspect captured patch +2 / −2
diff --git a/primitives/src/script/tests.rs b/primitives/src/script/tests.rs
index 2231b12d..4bccf3c2 100644
--- a/primitives/src/script/tests.rs
+++ b/primitives/src/script/tests.rs
@@ -339,7 +339,7 @@ fn legacy_opcode() {
#[cfg(feature = "hex")]
fn script_to_hex() {
let script = Script::from_bytes(&[0xa1, 0xb2, 0xc3]);
- let hex = alloc::format!("{script:x}");
+ let hex = format!("{script:x}");
assert_eq!(hex, "a1b2c3");
}
@@ -347,6 +347,6 @@ fn script_to_hex() {
#[cfg(feature = "hex")]
fn script_buf_to_hex() {
let script = ScriptBuf::from_bytes(vec![0xa1, 0xb2, 0xc3]);
- let hex = alloc::format!("{script:x}");
+ let hex = format!("{script:x}");
assert_eq!(hex, "a1b2c3");
}
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.