cargo fmt

This commit is contained in:
Nicolas Luck
2023-12-04 20:18:41 +01:00
parent 99055b553a
commit 24e3e1794e
2 changed files with 13 additions and 20 deletions

View File

@@ -197,8 +197,11 @@ impl Machine {
// println!("Result: {} = {}", var_key.to_string(), output); // println!("Result: {} = {}", var_key.to_string(), output);
if 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)); matches.push(QueryResolutionLine::Match(bindings));
@@ -345,17 +348,14 @@ mod tests {
let mut machine = Machine::new_lib(); let mut machine = Machine::new_lib();
machine.load_module_string( machine.load_module_string(
"facts", "facts",
r#" r#"
:- discontiguous(subject_class/2). :- discontiguous(subject_class/2).
"#.to_string()); "#
.to_string(),
let result = machine.run_query(String::from(
"subject_class(X, _).",
));
assert_eq!(
result,
Ok(QueryResolution::True)
); );
let result = machine.run_query(String::from("subject_class(X, _)."));
assert_eq!(result, Ok(QueryResolution::True));
} }
#[test] #[test]

View File

@@ -497,18 +497,11 @@ impl MachineState {
let stub = functor!( let stub = functor!(
atom!("module_does_not_contain_claimed_export"), 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] [functor_stub]
); );
self.permission_error( self.permission_error(Permission::Access, atom!("private_procedure"), stub)
Permission::Access,
atom!("private_procedure"),
stub,
)
} }
SessionError::ModuleCannotImportSelf(module_name) => { SessionError::ModuleCannotImportSelf(module_name) => {
let error_atom = atom!("module_cannot_import_self"); let error_atom = atom!("module_cannot_import_self");