Skip to content

Commit 8d4d878

Browse files
committed
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.)
1 parent c6b7558 commit 8d4d878

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
225225

226226
let mut on_stack_param_indices = FxHashSet::default();
227227
if let Some(indices) = self.on_stack_params.borrow().get(&gcc_func) {
228-
on_stack_param_indices = indices.clone();
228+
on_stack_param_indices.clone_from(indices);
229229
}
230230

231231
if all_args_match {

src/debuginfo.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
279279
) -> Self::DILocation {
280280
let pos = span.lo();
281281
let DebugLoc { file, line, col } = self.lookup_debug_loc(pos);
282-
let loc = match &file.name {
283-
rustc_span::FileName::Real(ref name) => match &name {
284-
rustc_span::RealFileName::LocalPath(ref name) => {
282+
let loc = match file.name {
283+
rustc_span::FileName::Real(ref name) => match name.clone() {
284+
rustc_span::RealFileName::LocalPath(name) => {
285285
if let Some(name) = name.to_str() {
286286
self.context.new_location(name, line as i32, col as i32)
287287
} else {

0 commit comments

Comments
 (0)