Skip to content

Commit f2e544e

Browse files
committed
Merge rust-bitcoin#5066: refactor: remove redundant type casts in push_bytes macro
9d1d82c refactor: remove redundant type casts in push_bytes macro (Daniel) Pull request description: Rust's automatic type coercion handles array-to-slice conversion, making the explicit `as &[_]` casts redundant. This change makes the code more idiomatic while maintaining identical functionality. ACKs for top commit: apoelstra: ACK 9d1d82c; successfully ran local tests Tree-SHA512: b06259950e8c02e4b8ba96f43717ab16c41adf4f426ae07347f8e96e1047bcf5e378b4137481988a694351261d94588989814f16d4665fdd705c1ca33763d108
2 parents 1a1c734 + 9d1d82c commit f2e544e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bitcoin/src/blockdata/script/push_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ mod primitive {
167167

168168
impl From<[u8; $len]> for PushBytesBuf {
169169
fn from(bytes: [u8; $len]) -> Self {
170-
PushBytesBuf(Vec::from(&bytes as &[_]))
170+
PushBytesBuf(Vec::from(&bytes))
171171
}
172172
}
173173

174174
impl<'a> From<&'a [u8; $len]> for PushBytesBuf {
175175
fn from(bytes: &'a [u8; $len]) -> Self {
176-
PushBytesBuf(Vec::from(bytes as &[_]))
176+
PushBytesBuf(Vec::from(bytes))
177177
}
178178
}
179179
)*

0 commit comments

Comments
 (0)