more efficient tracebacks

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2024-06-11 17:08:08 -07:00
parent 8f0e2512cc
commit 9796c20c5d
2 changed files with 6 additions and 7 deletions

View file

@ -35,10 +35,9 @@ impl Traceback {
Traceback(vec![])
}
pub fn with_trace(&self, item: TraceItem) -> Traceback {
let mut next = Traceback(self.0.clone());
next.0.push(item);
next
pub fn with_trace(mut self, item: TraceItem) -> Traceback {
self.0.push(item);
self
}
pub fn depth(&self) -> usize {