Merge rust-bitcoin/rust-bitcoin#4372: Automated nightly rustfmt (2025-04-20)
2c1ce53deb
2025-04-20 automated rustfmt nightly (Fmt Bot)
Pull request description:
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
ACKs for top commit:
apoelstra:
ACK 2c1ce53deb2fb2dc56546c9151c5fb61520f4713; successfully ran local tests
Tree-SHA512: 566535deece199d3a19910d6b033f8bf3ddbce27092f218041ebb1694b5f6184e4851ae9a54ddd0887c56f73e8083441e1769785109688c3c6f2a57120805229
This commit is contained in:
commit
8276e4d0e5
|
@ -84,9 +84,7 @@ impl Builder {
|
|||
match bytes[0] {
|
||||
0x81 => self.push_opcode(OP_PUSHNUM_NEG1),
|
||||
0 => self.push_opcode(OP_PUSHBYTES_0),
|
||||
1..=16 => {
|
||||
self.push_opcode(Opcode::from(bytes[0] + (OP_PUSHNUM_1.to_u8() - 1)))
|
||||
}
|
||||
1..=16 => self.push_opcode(Opcode::from(bytes[0] + (OP_PUSHNUM_1.to_u8() - 1))),
|
||||
_ => self, // unreachable arm
|
||||
}
|
||||
} else {
|
||||
|
@ -99,10 +97,7 @@ impl Builder {
|
|||
/// Standardness rules require push minimality according to [CheckMinimalPush] of core.
|
||||
///
|
||||
/// [CheckMinimalPush]: <https://github.com/bitcoin/bitcoin/blob/99a4ddf5ab1b3e514d08b90ad8565827fda7b63b/src/script/script.cpp#L366>
|
||||
pub fn push_slice_non_minimal<T: AsRef<PushBytes>>(
|
||||
mut self,
|
||||
data: T,
|
||||
) -> Builder {
|
||||
pub fn push_slice_non_minimal<T: AsRef<PushBytes>>(mut self, data: T) -> Builder {
|
||||
self.0.push_slice_non_minimal(data);
|
||||
self.1 = None;
|
||||
self
|
||||
|
|
|
@ -916,7 +916,7 @@ mod tests {
|
|||
assert!(formatted_script.contains("<unexpected end>"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[test]
|
||||
fn legacy_opcode() {
|
||||
let script = Script::from_bytes(&[0x03, 0xaa, 0xbb, 0xcc]);
|
||||
assert_eq!(format!("{}", script), "OP_PUSHBYTES_3 aabbcc");
|
||||
|
|
Loading…
Reference in New Issue