From 2dd1f6e8808089a4984005112d7cf05708c5b636 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 4 Nov 2023 19:32:23 -0600 Subject: [PATCH] fix compare_pstr_to_string (#2148) --- src/machine/partial_string.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/machine/partial_string.rs b/src/machine/partial_string.rs index 2123513d..cfbd4d8b 100644 --- a/src/machine/partial_string.rs +++ b/src/machine/partial_string.rs @@ -68,7 +68,7 @@ pub struct HeapPStrIter<'a> { stepper: fn(&mut HeapPStrIter<'a>) -> Option, } -#[derive(Debug)] +#[derive(Debug, Clone, Copy)] pub struct PStrPrefixCmpResult { pub focus: usize, pub offset: usize, @@ -193,7 +193,7 @@ impl<'a> HeapPStrIter<'a> { } } - final_result + Some(result) } fn walk_hare_to_cycle_end(&mut self) { @@ -336,9 +336,9 @@ impl<'a> HeapPStrIter<'a> { ); return value.as_char().map(|c| PStrIterStep { - iteratee: PStrIteratee::Char(curr_hare, c), - next_hare: h+1, - }); + iteratee: PStrIteratee::Char(curr_hare, c), + next_hare: h+1, + }); } (HeapCellValueTag::Str, s) => { let (name, arity) = cell_as_atom_cell!(self.heap[s]) -- 2.54.0