Merge rust-bitcoin/rust-bitcoin#4043: Implement Default for Script
ab2f709181
Implement Default for Script (jrakibi) Pull request description: This PR implements Default for `Script` to return an empty script. *Note: ScriptBuf already has `#[derive(Default)]` in the code so it's already handled* Resolves #3735 ACKs for top commit: tcharding: ACKab2f709181
Kixunil: ACKab2f709181
apoelstra: ACK ab2f7091814333b20669d41f1f78e0e52795df08; successfully ran local tests; neat! Tree-SHA512: c06ba98d9bf8568e323ef9082a7f06756586360d6bef2b93721db7f6e28a777852e494c86319c97b0fd5444a0010d6c679625753534c0e1c8116e452ce8fa9cc
This commit is contained in:
commit
0a19d0140c
|
@ -56,6 +56,11 @@ use crate::prelude::{Box, ToOwned, Vec};
|
|||
#[repr(transparent)]
|
||||
pub struct Script(pub(in crate::script) [u8]);
|
||||
|
||||
impl Default for &Script {
|
||||
#[inline]
|
||||
fn default() -> Self { Script::new() }
|
||||
}
|
||||
|
||||
impl ToOwned for Script {
|
||||
type Owned = ScriptBuf;
|
||||
|
||||
|
|
Loading…
Reference in New Issue