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:
parent
c6b75581d0
commit
8d4d87859b
2 changed files with 4 additions and 4 deletions
|
|
@ -225,7 +225,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
|
|||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -279,9 +279,9 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
|
|||
) -> 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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue