Skip to content

Commit

Permalink
chore: Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo committed Oct 16, 2024
1 parent 6e56ede commit 92cf8f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
13 changes: 7 additions & 6 deletions lib/compiler-llvm/src/abi/aarch64_systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ impl Abi for Aarch64SystemV {
}
} else {
// Either sret or vmctx.
if call_site.count_arguments() <= 0 {
return Err(CompileError::Codegen(format!(
"Expected call site to have at least one argument, none was found"
)));
if call_site.count_arguments() == 0 {
return Err(CompileError::Codegen(
"Expected call site to have at least one argument, none was found".to_string(),
));
}
if call_site
.get_enum_attribute(
Expand Down Expand Up @@ -513,9 +513,10 @@ impl Abi for Aarch64SystemV {
rets.push(value);
}
if func_sig.results().len() != rets.len() {
return Err(CompileError::Codegen(format!(
return Err(CompileError::Codegen(
"The number of returns does not match the signature of the function"
)));
.to_string(),
));
}
Ok(rets)
} else {
Expand Down
19 changes: 10 additions & 9 deletions lib/compiler-llvm/src/abi/x86_64_systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,10 @@ impl Abi for X86_64SystemV {
}
} else {
// Either sret or vmctx.
if call_site.count_arguments() > 0 {
return Err(CompileError::Codegen(format!(
"Expected call site to have at least one argument, none was found"
)));
if call_site.count_arguments() == 0 {
return Err(CompileError::Codegen(
"Expected call site to have at least one argument, none was found".to_string(),
));
}
if call_site
.get_enum_attribute(
Expand Down Expand Up @@ -593,9 +593,10 @@ impl Abi for X86_64SystemV {
rets.push(value);
}
if func_sig.results().len() != rets.len() {
return Err(CompileError::Codegen(format!(
return Err(CompileError::Codegen(
"The number of returns does not match the signature of the function"
)));
.to_string(),
));
}
Ok(rets)
} else {
Expand Down Expand Up @@ -731,9 +732,9 @@ impl Abi for X86_64SystemV {
}
[v1, v2] => {
if is_32(v1) && is_32(v2) {
return Err(CompileError::Codegen(format!(
"Not both values should be i32",
)));
return Err(CompileError::Codegen(
"Not both values should be i32".to_string(),
));
}
build_struct(
func_type.get_return_type().unwrap().into_struct_type(),
Expand Down

0 comments on commit 92cf8f1

Please sign in to comment.