fix cargo fmt

This commit is contained in:
Mark Thom
2025-12-13 18:22:15 -08:00
parent 6284aa3a3f
commit e2bdf59c81

View File

@@ -1,11 +1,11 @@
use crate::forms::*; use crate::forms::*;
use crate::heap_iter::*; use crate::heap_iter::*;
use crate::types::*;
use crate::machine::*;
use crate::machine::heap::*; use crate::machine::heap::*;
use crate::machine::*;
use crate::types::*;
use fxhash::{FxHasher, FxBuildHasher}; use fxhash::{FxBuildHasher, FxHasher};
use hashbrown::{HashTable}; use hashbrown::HashTable;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
@@ -91,7 +91,7 @@ impl MachineState {
hasher.write_u64(*canonical_id); hasher.write_u64(*canonical_id);
} }
_ => { _ => {
if let Some(n) = Number::try_from((term, &self.arena.f64_tbl)).ok() { if let Ok(n) = Number::try_from((term, &self.arena.f64_tbl)) {
match n { match n {
Number::Float(f) => f.hash(&mut hasher), Number::Float(f) => f.hash(&mut hasher),
Number::Integer(n) => n.hash(&mut hasher), Number::Integer(n) => n.hash(&mut hasher),
@@ -141,25 +141,30 @@ impl MachineState {
let mut list_of_lists = Vec::with_capacity(table.len()); let mut list_of_lists = Vec::with_capacity(table.len());
for (_, keys, variants) in table { for (_, keys, variants) in table {
if let None = keys.windows(2).try_for_each(|cells| { if keys
.windows(2)
.try_for_each(|cells| {
unify_fn!(*self, cells[0], cells[1]); unify_fn!(*self, cells[0], cells[1]);
if self.fail { None } else { Some(()) } if self.fail {
}) { None
} else {
Some(())
}
})
.is_none()
{
return Ok(()); return Ok(());
} }
let variant_list_cell = resource_error_call_result!( let variant_list_cell = resource_error_call_result!(
self, self,
sized_iter_to_heap_list( sized_iter_to_heap_list(&mut self.heap, variants.len(), variants.into_iter(),)
&mut self.heap,
variants.len(),
variants.into_iter(),
)
); );
let mut writer = resource_error_call_result!(self, self.heap.reserve(3)); let mut writer = resource_error_call_result!(self, self.heap.reserve(3));
let key_val_cell = writer.write_with(|section| { let key_val_cell = writer
.write_with(|section| {
let key_val_cell = str_loc_as_cell!(section.cell_len()); let key_val_cell = str_loc_as_cell!(section.cell_len());
section.push_cell(atom_as_cell!(atom!("-"), 2)); section.push_cell(atom_as_cell!(atom!("-"), 2));
@@ -167,7 +172,8 @@ impl MachineState {
section.push_cell(variant_list_cell); section.push_cell(variant_list_cell);
key_val_cell key_val_cell
}).result; })
.result;
list_of_lists.push(key_val_cell); list_of_lists.push(key_val_cell);
} }
@@ -186,5 +192,3 @@ impl MachineState {
Ok(()) Ok(())
} }
} }