fix clippy::uninlined_format_args
This commit is contained in:
@@ -1407,10 +1407,10 @@ impl MachineState {
|
||||
term_stack.push(Term::Literal(Cell::default(), Literal::try_from(addr).unwrap()));
|
||||
}
|
||||
(HeapCellValueTag::StackVar, h) => {
|
||||
term_stack.push(Term::Var(Cell::default(), VarPtr::from(format!("s_{}", h))));
|
||||
term_stack.push(Term::Var(Cell::default(), VarPtr::from(format!("s_{h}"))));
|
||||
}
|
||||
(HeapCellValueTag::Var | HeapCellValueTag::AttrVar, h) => {
|
||||
term_stack.push(Term::Var(Cell::default(), VarPtr::from(format!("_{}", h))));
|
||||
term_stack.push(Term::Var(Cell::default(), VarPtr::from(format!("_{h}"))));
|
||||
}
|
||||
(HeapCellValueTag::Atom, (name, arity)) => {
|
||||
let h = iter.focus().value() as usize;
|
||||
|
||||
@@ -206,7 +206,7 @@ impl VarKey {
|
||||
#[inline]
|
||||
pub(crate) fn to_string(&self) -> String {
|
||||
match self {
|
||||
VarKey::AnonVar(h) => format!("_{}", h),
|
||||
VarKey::AnonVar(h) => format!("_{h}"),
|
||||
VarKey::VarPtr(var) => var.borrow().to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,15 +195,11 @@ pub fn all_cells_marked_and_unforwarded(heap: &Heap, offset: usize) {
|
||||
|
||||
assert!(
|
||||
cell.get_mark_bit(),
|
||||
"cell {:?} at index {} is not marked",
|
||||
cell,
|
||||
curr_idx
|
||||
"cell {cell:?} at index {curr_idx} is not marked"
|
||||
);
|
||||
assert!(
|
||||
!cell.get_forwarding_bit(),
|
||||
"cell {:?} at index {} is forwarded",
|
||||
cell,
|
||||
curr_idx
|
||||
"cell {cell:?} at index {curr_idx} is forwarded"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -227,9 +223,7 @@ pub fn all_cells_unmarked(iter: &impl SizedHeap) {
|
||||
|
||||
assert!(
|
||||
!cell.get_mark_bit(),
|
||||
"cell {:?} at index {} is still marked",
|
||||
cell,
|
||||
curr_idx
|
||||
"cell {cell:?} at index {curr_idx} is still marked"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2916,7 +2916,7 @@ impl Machine {
|
||||
|
||||
let string = match Number::try_from((n, &self.machine_st.arena.f64_tbl)) {
|
||||
Ok(Number::Float(OrderedFloat(n))) => {
|
||||
format!("{0:<20?}", n)
|
||||
format!("{n:<20?}")
|
||||
}
|
||||
Ok(Number::Fixnum(n)) => n.get_num().to_string(),
|
||||
Ok(Number::Integer(n)) => n.to_string(),
|
||||
@@ -3245,7 +3245,7 @@ impl Machine {
|
||||
let n: u32 = (&*n).try_into().unwrap();
|
||||
let n = char::try_from(n);
|
||||
if let Ok(c) = n {
|
||||
write!(&mut stream, "{}", c).unwrap();
|
||||
write!(&mut stream, "{c}").unwrap();
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
@@ -3253,7 +3253,7 @@ impl Machine {
|
||||
let n = n.get_num();
|
||||
|
||||
if let Some(c) = u32::try_from(n).ok().and_then(char::from_u32) {
|
||||
write!(&mut stream, "{}", c).unwrap();
|
||||
write!(&mut stream, "{c}").unwrap();
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
@@ -3295,13 +3295,13 @@ impl Machine {
|
||||
read_heap_cell!(addr,
|
||||
(HeapCellValueTag::Atom, (name, _arity)) => {
|
||||
if let Some(c) = name.as_char() {
|
||||
write!(&mut stream, "{}", c).unwrap();
|
||||
write!(&mut stream, "{c}").unwrap();
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
/*
|
||||
(HeapCellValueTag::Char, c) => {
|
||||
write!(&mut stream, "{}", c).unwrap();
|
||||
write!(&mut stream, "{c}").unwrap();
|
||||
return Ok(());
|
||||
}
|
||||
*/
|
||||
@@ -8622,7 +8622,7 @@ impl Machine {
|
||||
];
|
||||
|
||||
for spec in SPECIFIERS {
|
||||
fstr.push_str(&format!("'{}'=\"%{}\", ", spec, spec).to_string());
|
||||
fstr.push_str(&format!("'{spec}'=\"%{spec}\", "));
|
||||
}
|
||||
|
||||
fstr.push_str("finis].");
|
||||
|
||||
Reference in New Issue
Block a user