Fix Clippy

This commit is contained in:
bakaq
2024-09-06 18:54:37 -03:00
parent d32f3ee2f3
commit 16734ec7e4
8 changed files with 37 additions and 39 deletions

View File

@@ -1194,11 +1194,8 @@ fn print_overwrite_warning(
key: PredicateKey,
is_dynamic: bool,
) {
if let CompilationTarget::Module(module_name) = compilation_target {
match module_name {
atom!("builtins") | atom!("loader") => return,
_ => {}
}
if let CompilationTarget::Module(atom!("builtins") | atom!("loader")) = compilation_target {
return;
}
match code_ptr.tag() {

View File

@@ -4611,11 +4611,11 @@ impl Machine {
self.shell();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallPID => {
&Instruction::CallPid => {
self.pid();
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecutePID => {
&Instruction::ExecutePid => {
self.pid();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}

View File

@@ -213,8 +213,7 @@ impl<'a> HeapPStrIter<'a> {
self.brent_st.hare = orig_hare;
}
#[allow(clippy::inherent_to_string)]
pub fn to_string(&mut self) -> String {
pub fn to_string_mut(&mut self) -> String {
let mut buf = String::with_capacity(32);
for iteratee in self.by_ref() {

View File

@@ -1040,7 +1040,7 @@ impl MachineState {
self.heap.push(value);
let mut iter = HeapPStrIter::new(&self.heap, h);
let string = iter.to_string();
let string = iter.to_string_mut();
let at_terminator = iter.at_string_terminator();
self.heap.pop();