Skip to content

Commit a4d6c61

Browse files
committed
add #[rustc_pass_by_value] to more types
1 parent d3bc129 commit a4d6c61

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

clippy_lints/src/redundant_clone.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ impl<'a, 'tcx> PossibleBorrowerVisitor<'a, 'tcx> {
543543
continue;
544544
}
545545

546-
let borrowers = self.possible_borrower.reachable_from(&row);
546+
let borrowers = self.possible_borrower.reachable_from(row);
547547
if !borrowers.is_empty() {
548548
let mut bs = HybridBitSet::new_empty(self.body.local_decls.len());
549-
for &c in borrowers {
549+
for c in borrowers {
550550
if c != mir::Local::from_usize(0) {
551551
bs.insert(c);
552552
}
@@ -663,10 +663,10 @@ impl<'a, 'tcx> PossibleOriginVisitor<'a, 'tcx> {
663663
continue;
664664
}
665665

666-
let borrowers = self.possible_origin.reachable_from(&row);
666+
let borrowers = self.possible_origin.reachable_from(row);
667667
if !borrowers.is_empty() {
668668
let mut bs = HybridBitSet::new_empty(self.body.local_decls.len());
669-
for &c in borrowers {
669+
for c in borrowers {
670670
if c != mir::Local::from_usize(0) {
671671
bs.insert(c);
672672
}

clippy_utils/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
489489
fn find_crate(tcx: TyCtxt<'_>, name: &str) -> Option<DefId> {
490490
tcx.crates(())
491491
.iter()
492-
.find(|&&num| tcx.crate_name(num).as_str() == name)
492+
.copied()
493+
.find(|&num| tcx.crate_name(num).as_str() == name)
493494
.map(CrateNum::as_def_id)
494495
}
495496

0 commit comments

Comments
 (0)