Skip to content

Commit a309468

Browse files
authored
Rollup merge of #80348 - matthiaskrgr:less_clones, r=Dylan-DPC
remove redundant clones (clippy::redundant_clone)
2 parents 3fe4236 + 6e852cc commit a309468

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_infer/src/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13171317
T: TypeFoldable<'tcx>,
13181318
{
13191319
if !value.needs_infer() {
1320-
return value.clone(); // Avoid duplicated subst-folding.
1320+
return value; // Avoid duplicated subst-folding.
13211321
}
13221322
let mut r = resolve::OpportunisticVarResolver::new(self);
13231323
value.fold_with(&mut r)

compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ struct SplitIntRange {
328328
}
329329

330330
impl SplitIntRange {
331-
fn new(r: IntRange) -> Self {
332-
SplitIntRange { range: r.clone(), borders: Vec::new() }
331+
fn new(range: IntRange) -> Self {
332+
SplitIntRange { range, borders: Vec::new() }
333333
}
334334

335335
/// Internal use

0 commit comments

Comments
 (0)