Merge rust-bitcoin/rust-bitcoin#1301: `AsMut` impls for `Magic`
bfb4977be9
implement `AsMut<[u8]>` and `AsMut<[u8;4]>` for `Magic` (Noah) Pull request description: Follow up to https://github.com/rust-bitcoin/rust-bitcoin/pull/1288#discussion_r982152738 Implemented `AsMut<[u8]>` and `AsMut<[u8;4]>` for `Magic`. ACKs for top commit: Kixunil: ACKbfb4977be9
apoelstra: ACKbfb4977be9
Tree-SHA512: f1732f2b6db285e64baf07e70917eb8c0938b3a8d11f8266c0f2c846b7b2d4447cb99721b55c9db877f88c398dd74477c41bdae34679b6c3b6ade71455538241
This commit is contained in:
commit
f6d838076e
|
@ -265,6 +265,18 @@ impl AsRef<[u8; 4]> for Magic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AsMut<[u8]> for Magic {
|
||||||
|
fn as_mut(&mut self) -> &mut [u8] {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AsMut<[u8; 4]> for Magic {
|
||||||
|
fn as_mut(&mut self) -> &mut [u8; 4] {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Borrow<[u8]> for Magic {
|
impl Borrow<[u8]> for Magic {
|
||||||
fn borrow(&self) -> &[u8] {
|
fn borrow(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
Loading…
Reference in New Issue