]> Repositorios git - scryer-prolog.git/commitdiff
fix compare_pstr_to_string (#2148)
authorMark <[email protected]>
Sun, 5 Nov 2023 01:32:23 +0000 (19:32 -0600)
committerMark <[email protected]>
Sun, 5 Nov 2023 01:32:23 +0000 (19:32 -0600)
src/machine/partial_string.rs

index 2123513d39ae793e5c89aa133f9be5ca517f9147..cfbd4d8b6c86bcd267d959797e0b52384cc575cc 100644 (file)
@@ -68,7 +68,7 @@ pub struct HeapPStrIter<'a> {
     stepper: fn(&mut HeapPStrIter<'a>) -> Option<PStrIteratee>,
 }
 
-#[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])