feat: no clone in JIT
IMPORTANT: should not drop or create values in JIT anymore
This commit is contained in:
@@ -35,10 +35,7 @@ impl<T, const CAP: usize> Stack<T, CAP> {
|
||||
pub fn push(&mut self, item: T) -> Result<()> {
|
||||
self.items
|
||||
.get_mut(self.top)
|
||||
.map_or_else(
|
||||
|| Err(Error::EvalError("stack overflow".to_string())),
|
||||
Ok,
|
||||
)?
|
||||
.map_or_else(|| Err(Error::EvalError("stack overflow".to_string())), Ok)?
|
||||
.write(item);
|
||||
self.top += 1;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user