fix(clippy): Clone-related clippy workarounds

1. Use `clone_from` in place of `clone()` in `builder.rs`
2. Change `&name` to `name.clone()` in `debuginfo.rs`(Is this really
efficient? But I can't find other workarounds.)
This commit is contained in:
tempdragon 2024-03-11 12:13:30 +08:00
parent c6b75581d0
commit 8d4d87859b
2 changed files with 4 additions and 4 deletions

View File

@ -225,7 +225,7 @@ fn check_ptr_call<'b>(
let mut on_stack_param_indices = FxHashSet::default();
if let Some(indices) = self.on_stack_params.borrow().get(&gcc_func) {
on_stack_param_indices = indices.clone();
on_stack_param_indices.clone_from(indices);
}
if all_args_match {

View File

@ -279,9 +279,9 @@ fn dbg_loc(
) -> Self::DILocation {
let pos = span.lo();
let DebugLoc { file, line, col } = self.lookup_debug_loc(pos);
let loc = match &file.name {
rustc_span::FileName::Real(ref name) => match &name {
rustc_span::RealFileName::LocalPath(ref name) => {
let loc = match file.name {
rustc_span::FileName::Real(ref name) => match name.clone() {
rustc_span::RealFileName::LocalPath(name) => {
if let Some(name) = name.to_str() {
self.context.new_location(name, line as i32, col as i32)
} else {