bitcoin: Remove call to deprecated function
What changed, and why it matters
This is a routine code cleanup in an example file. A developer replaced one function call with another that does the same thing, because the old function name is being retired. There is no security issue here.
No action required. This is a benign maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies bitcoin/examples/script.rs, replacing a call to the deprecated Script::to_bytes() with the non-deprecated Script::to_vec(). Both methods return the same byte vector representation of the script; this is a pure API migration with no behavioral or security change. The change is in example code, not library code, and has no effect on downstream consumers.
Changed components
bitcoin/examples/script.rsInspect captured patch +1 / −1
diff --git a/bitcoin/examples/script.rs b/bitcoin/examples/script.rs
index 5cf3a5c9..25585e05 100644
--- a/bitcoin/examples/script.rs
+++ b/bitcoin/examples/script.rs
@@ -77,7 +77,7 @@ fn main() {
assert_eq!(decoded, script_code);
// to/from bytes excludes the prefix, these are not encoding/decoding functions so this is sane.
- let bytes = script_code.to_bytes();
+ let bytes = script_code.to_vec();
let got = WitnessScriptBuf::from_bytes(bytes);
assert_eq!(got, script_code);
}
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.