Skip to content

Commit

Permalink
Implement Default for Script
Browse files Browse the repository at this point in the history
Add Default implementation for Script that returns an empty script.

ScriptBuf already has #[derive(Default)] in the code so it's already handled
  • Loading branch information
jrakibi committed Feb 12, 2025
1 parent 58bb2b1 commit ab2f709
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions primitives/src/script/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ab2f709

Please sign in to comment.