Implement AsRef<[u8]> for Script
This commit is contained in:
parent
6a0f68df85
commit
96fa4b7d9b
|
@ -43,6 +43,12 @@ use util::key::PublicKey;
|
||||||
/// A Bitcoin script
|
/// A Bitcoin script
|
||||||
pub struct Script(Box<[u8]>);
|
pub struct Script(Box<[u8]>);
|
||||||
|
|
||||||
|
impl AsRef<[u8]> for Script {
|
||||||
|
fn as_ref(&self) -> &[u8] {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Script {
|
impl fmt::Debug for Script {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str("Script(")?;
|
f.write_str("Script(")?;
|
||||||
|
|
Loading…
Reference in New Issue