Implement Default for Script
Add Default implementation for Script that returns an empty script. ScriptBuf already has #[derive(Default)] in the code so it's already handled
This commit is contained in:
parent
58bb2b1200
commit
ab2f709181
|
@ -56,6 +56,11 @@ use crate::prelude::{Box, ToOwned, Vec};
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct Script(pub(in crate::script) [u8]);
|
pub struct Script(pub(in crate::script) [u8]);
|
||||||
|
|
||||||
|
impl Default for &Script {
|
||||||
|
#[inline]
|
||||||
|
fn default() -> Self { Script::new() }
|
||||||
|
}
|
||||||
|
|
||||||
impl ToOwned for Script {
|
impl ToOwned for Script {
|
||||||
type Owned = ScriptBuf;
|
type Owned = ScriptBuf;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue