From: Skgland Date: Wed, 19 Nov 2025 23:19:24 +0000 (+0100) Subject: propagate AllocErrro instead of unwrapping X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=6063783e9dfcf15de007f15db20c1aeecee0a173;p=scryer-prolog.git propagate AllocErrro instead of unwrapping --- diff --git a/src/machine/copier.rs b/src/machine/copier.rs index 42359806..4de9a0c1 100644 --- a/src/machine/copier.rs +++ b/src/machine/copier.rs @@ -306,7 +306,7 @@ impl CopyTermState { let heap_loc = list_addr.get_value() as usize; let str_loc = self.target[heap_loc].get_value() as usize; let str_cell = self.target[str_loc]; - let mut writer = self.target.reserve(3).unwrap(); + let mut writer = self.target.reserve(3)?; writer.write_with(|section| { section.push_cell(heap_loc_as_cell!(threshold + 2)); @@ -435,7 +435,7 @@ impl CopyTermState { let str_cell = if get_structure_index(index_cell).is_some() { // copy the index pointer trailing this // inlined or expanded goal. - let mut writer = self.target.reserve(1).unwrap(); + let mut writer = self.target.reserve(1)?; writer.write_with(|section| { section.push_cell(index_cell);