feat: no clone in JIT

IMPORTANT: should not drop or create values in JIT anymore
This commit is contained in:
2025-05-21 20:48:56 +08:00
parent 177acfabcf
commit 2a19ddb279
11 changed files with 105 additions and 82 deletions

View File

@@ -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(())