diff --git a/lib/interface-types/src/instructions/stack.rs b/lib/interface-types/src/instructions/stack.rs index 1d139a77c..d62d40d7c 100644 --- a/lib/interface-types/src/instructions/stack.rs +++ b/lib/interface-types/src/instructions/stack.rs @@ -8,18 +8,29 @@ pub trait Stackable { fn pop(&mut self, n: usize) -> Option>; } -#[derive(Debug)] -pub struct Stack { +#[derive(Debug, Default)] +pub struct Stack +where + T: Default, +{ inner: Vec, } -impl Stack { +impl Stack +where + T: Default, +{ pub fn new() -> Self { - Self { inner: Vec::new() } + Self { + ..Default::default() + } } } -impl Stackable for Stack { +impl Stackable for Stack +where + T: Default, +{ type Item = T; fn is_empty(&self) -> bool {