]> Repositorios git - scryer-prolog.git/commitdiff
fix clone on copy values
authorBennet Bleßmann <[email protected]>
Thu, 31 Jul 2025 19:28:30 +0000 (21:28 +0200)
committerBennet Bleßmann <[email protected]>
Thu, 31 Jul 2025 19:28:39 +0000 (21:28 +0200)
build/instructions_template.rs
src/functor_macro.rs
src/machine/compile.rs

index 2f760ea1549816a272d4c1d46613e7248d532d73..31c329b98adff4f725bd40f56e119c7c48824b9d 100644 (file)
@@ -1055,7 +1055,7 @@ fn generate_instruction_preface() -> TokenStream {
                             constants.iter().map(|(c, ptr)| {
                                 functor!(
                                     atom!(":"),
-                                    [cell((c.clone())), indexing_code_ptr((*ptr))]
+                                    [cell((*c)), indexing_code_ptr((*ptr))]
                                 )
                             }),
                         )
index 54bcb28ce740fced44fed9d01ccd5a7fdc66f3a9..591fa1856eadc21fd9d070b8a3eb0ca322a0f004 100644 (file)
@@ -698,9 +698,9 @@ mod tests {
         let functor = variadic_functor(
             atom!("switch_on_constants"),
             1,
-            constants.iter().map(|(c, ptr)| {
-                functor!(atom!(":"), [cell((c.clone())), indexing_code_ptr((*ptr))])
-            }),
+            constants
+                .iter()
+                .map(|(c, ptr)| functor!(atom!(":"), [cell((*c)), indexing_code_ptr((*ptr))])),
         );
 
         heap.truncate(0);
index 7dcbee142337a0ea7f87126c8534b158cb60f621..8e7990091807a277c1245075c58d32c41214b2fb 100644 (file)
@@ -133,7 +133,7 @@ fn merge_indices(
             );
 
             retraction_info.push_record(RetractionRecord::AddedIndex(
-                skeleton[clause_index].opt_arg_index_key.clone(),
+                skeleton[clause_index].opt_arg_index_key,
                 clause_loc,
             ));
         } else {
@@ -246,7 +246,7 @@ fn remove_index_from_subsequence(
         // appear anywhere inside an Internal record.
         retraction_info.push_record(RetractionRecord::RemovedIndex(
             index_loc,
-            opt_arg_index_key.clone(),
+            *opt_arg_index_key,
             offset,
         ));
     }
@@ -808,7 +808,7 @@ fn prepend_compiled_clause(
                 skeleton.clauses[0].clause_start = clause_loc + 2;
 
                 retraction_info.push_record(RetractionRecord::AddedIndex(
-                    skeleton.clauses[0].opt_arg_index_key.clone(),
+                    skeleton.clauses[0].opt_arg_index_key,
                     skeleton.clauses[0].clause_start,
                 ));
 
@@ -1070,7 +1070,7 @@ fn append_compiled_clause(
             skeleton.clauses[target_pos].opt_arg_index_key += index_loc - 1;
 
             retraction_info.push_record(RetractionRecord::AddedIndex(
-                skeleton.clauses[target_pos].opt_arg_index_key.clone(),
+                skeleton.clauses[target_pos].opt_arg_index_key,
                 skeleton.clauses[target_pos].clause_start,
             ));