]> Repositorios git - scryer-prolog.git/commitdiff
cargo fmt
authorNicolas Luck <[email protected]>
Mon, 4 Dec 2023 19:18:41 +0000 (20:18 +0100)
committerNicolas Luck <[email protected]>
Mon, 4 Dec 2023 19:18:41 +0000 (20:18 +0100)
src/machine/lib_machine.rs
src/machine/machine_errors.rs

index 9d166c51818a5378ccd4623ebe43ca41b367175e..240f1777c2f35b6efa24aeccf270783d59b0125a 100644 (file)
@@ -197,8 +197,11 @@ impl Machine {
                 // println!("Result: {} = {}", var_key.to_string(), output);
 
                 if var_key.to_string() != output {
-                    bindings.insert(var_key.to_string(), Value::try_from(output).expect("Couldn't convert Houtput to Value"));
-                }   
+                    bindings.insert(
+                        var_key.to_string(),
+                        Value::try_from(output).expect("Couldn't convert Houtput to Value"),
+                    );
+                }
             }
 
             matches.push(QueryResolutionLine::Match(bindings));
@@ -345,17 +348,14 @@ mod tests {
         let mut machine = Machine::new_lib();
         machine.load_module_string(
             "facts",
-                r#"
+            r#"
                 :- discontiguous(subject_class/2).
-            "#.to_string());
-
-        let result = machine.run_query(String::from(
-            "subject_class(X, _).",
-        ));
-        assert_eq!(
-            result,
-            Ok(QueryResolution::True)
+            "#
+            .to_string(),
         );
+
+        let result = machine.run_query(String::from("subject_class(X, _)."));
+        assert_eq!(result, Ok(QueryResolution::True));
     }
 
     #[test]
index 02133f323b3667c5d62f88fe6a142b3fb7048d84..49d565100ebcddb2862bf78c86c341d426ac84fa 100644 (file)
@@ -497,18 +497,11 @@ impl MachineState {
 
                 let stub = functor!(
                     atom!("module_does_not_contain_claimed_export"),
-                    [
-                        atom(module_name),
-                        str(self.heap.len() + 4, 0)
-                    ],
+                    [atom(module_name), str(self.heap.len() + 4, 0)],
                     [functor_stub]
                 );
 
-                self.permission_error(
-                    Permission::Access,
-                    atom!("private_procedure"),
-                    stub,
-                )
+                self.permission_error(Permission::Access, atom!("private_procedure"), stub)
             }
             SessionError::ModuleCannotImportSelf(module_name) => {
                 let error_atom = atom!("module_cannot_import_self");