Skip to content

Commit

Permalink
Rollup merge of rust-lang#80348 - matthiaskrgr:less_clones, r=Dylan-DPC
Browse files Browse the repository at this point in the history
remove redundant clones (clippy::redundant_clone)
  • Loading branch information
JohnTitor authored Dec 30, 2020
2 parents 3fe4236 + 6e852cc commit a309468
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
T: TypeFoldable<'tcx>,
{
if !value.needs_infer() {
return value.clone(); // Avoid duplicated subst-folding.
return value; // Avoid duplicated subst-folding.
}
let mut r = resolve::OpportunisticVarResolver::new(self);
value.fold_with(&mut r)
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ struct SplitIntRange {
}

impl SplitIntRange {
fn new(r: IntRange) -> Self {
SplitIntRange { range: r.clone(), borders: Vec::new() }
fn new(range: IntRange) -> Self {
SplitIntRange { range, borders: Vec::new() }
}

/// Internal use
Expand Down

0 comments on commit a309468

Please sign in to comment.