Skip to content

Commit 28e2559

Browse files
committed
run cargo fmt
1 parent 5418a40 commit 28e2559

File tree

4 files changed

+41
-16
lines changed

4 files changed

+41
-16
lines changed

Diff for: src/heap_iter.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -2220,10 +2220,16 @@ mod tests {
22202220
assert_eq!(iter.next(), None);
22212221
}
22222222

2223-
assert_eq!(wam.machine_st.heap.slice_to_str(0, "a string".len()), "a string");
2224-
assert_eq!(wam.machine_st.heap[1], HeapCellValue::build_with(HeapCellValueTag::Cons, 0));
2223+
assert_eq!(
2224+
wam.machine_st.heap.slice_to_str(0, "a string".len()),
2225+
"a string"
2226+
);
2227+
assert_eq!(
2228+
wam.machine_st.heap[1],
2229+
HeapCellValue::build_with(HeapCellValueTag::Cons, 0)
2230+
);
22252231

2226-
for idx in 2 ..= 3 {
2232+
for idx in 2..=3 {
22272233
assert!(!wam.machine_st.heap[idx].get_mark_bit());
22282234
assert!(!wam.machine_st.heap[idx].get_forwarding_bit());
22292235
}
@@ -2970,7 +2976,6 @@ mod tests {
29702976
assert_eq!(wam.machine_st.heap[4], heap_loc_as_cell!(0));
29712977

29722978
wam.machine_st.heap.clear();
2973-
29742979
}
29752980

29762981
#[test]

Diff for: src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![recursion_limit = "4112"]
33
#![deny(missing_docs)]
44

5-
65
#[macro_use]
76
extern crate static_assertions;
87

Diff for: src/machine/gc.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl PStrLocValuesMap {
130130
}
131131

132132
fn progress_pstr_marking(&mut self, heap_slice: &[u8], pstr_loc: usize) -> usize {
133-
match self.hit_set.range(..= pstr_loc).next_back() {
133+
match self.hit_set.range(..=pstr_loc).next_back() {
134134
Some((_prev_pstr_loc, &tail_idx)) if pstr_loc < heap_index!(tail_idx) => {
135135
return tail_idx;
136136
}
@@ -142,7 +142,10 @@ impl PStrLocValuesMap {
142142
None => heap_slice.len(),
143143
};
144144

145-
match heap_slice[pstr_loc..delimiter].iter().position(|b| *b == 0u8) {
145+
match heap_slice[pstr_loc..delimiter]
146+
.iter()
147+
.position(|b| *b == 0u8)
148+
{
146149
Some(zero_byte_offset) => {
147150
let tail_idx = if (zero_byte_offset + 1) % Heap::heap_cell_alignment() == 0 {
148151
cell_index!(pstr_loc + zero_byte_offset) + 2
@@ -354,7 +357,8 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
354357
.pstr_loc_values
355358
.progress_pstr_marking(self.heap.as_slice(), pstr_loc);
356359

357-
self.pstr_loc_values.insert_pstr_loc_value(self.current, pstr_loc);
360+
self.pstr_loc_values
361+
.insert_pstr_loc_value(self.current, pstr_loc);
358362

359363
if self.heap[tail_idx].get_forwarding_bit() {
360364
return Some(self.backward_and_return());
@@ -379,10 +383,18 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
379383
}
380384
}
381385
HeapCellValueTag::Cons => {
382-
match self.pstr_loc_values.hit_set.range(.. heap_index!(self.current + 1)).next_back() {
386+
match self
387+
.pstr_loc_values
388+
.hit_set
389+
.range(..heap_index!(self.current + 1))
390+
.next_back()
391+
{
383392
Some((_prev_pstr_loc, &tail_idx)) if self.current + 1 == tail_idx => {
384393
let pstr_loc_loc = self.heap[self.current].get_value() as usize;
385-
let pstr_loc_val = self.pstr_loc_values.pstr_loc_loc_value(pstr_loc_loc).unwrap();
394+
let pstr_loc_val = self
395+
.pstr_loc_values
396+
.pstr_loc_loc_value(pstr_loc_loc)
397+
.unwrap();
386398

387399
self.heap[self.current].set_value(self.next);
388400

Diff for: src/machine/mock_wam.rs

+15-6
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,23 @@ mod tests {
439439

440440
assert!(!wam.fail);
441441

442-
assert_eq!(wam.heap.slice_to_str(heap_index!(0), "this is a string".len()),
443-
"this is a string");
442+
assert_eq!(
443+
wam.heap
444+
.slice_to_str(heap_index!(0), "this is a string".len()),
445+
"this is a string"
446+
);
444447
assert_eq!(wam.heap[3], pstr_loc_as_cell!(heap_index!(8)));
445-
assert_eq!(wam.heap.slice_to_str(heap_index!(4), "this is a string".len()),
446-
"this is a string");
448+
assert_eq!(
449+
wam.heap
450+
.slice_to_str(heap_index!(4), "this is a string".len()),
451+
"this is a string"
452+
);
447453
assert_eq!(wam.heap[7], pstr_loc_as_cell!(heap_index!(8)));
448-
assert_eq!(wam.heap.slice_to_str(heap_index!(8), "this is a string".len()),
449-
"this is a string");
454+
assert_eq!(
455+
wam.heap
456+
.slice_to_str(heap_index!(8), "this is a string".len()),
457+
"this is a string"
458+
);
450459
assert_eq!(wam.heap[11], pstr_loc_as_cell!(heap_index!(8)));
451460

452461
wam.heap.clear();

0 commit comments

Comments
 (0)