don't clone types that are Copy (clippy::clone_on_copy)

This commit is contained in:
Matthias Krüger 2021-09-11 10:18:56 +02:00
parent 22719efcc5
commit c1e96085d3
15 changed files with 30 additions and 34 deletions

View file

@ -75,13 +75,11 @@ fn lower_slice_len_call<'tcx>(
let deref_arg = tcx.mk_place_deref(arg);
let r_value = Rvalue::Len(deref_arg);
let len_statement_kind = StatementKind::Assign(Box::new((*dest, r_value)));
let add_statement = Statement {
kind: len_statement_kind,
source_info: terminator.source_info.clone(),
};
let add_statement =
Statement { kind: len_statement_kind, source_info: terminator.source_info };
// modify terminator into simple Goto
let new_terminator_kind = TerminatorKind::Goto { target: bb.clone() };
let new_terminator_kind = TerminatorKind::Goto { target: *bb };
let patch = SliceLenPatchInformation { add_statement, new_terminator_kind };