Skip to content

Commit 4a06145

Browse files
Use ControlFlow::is{break,continue}
1 parent fa79cc4 commit 4a06145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/redundant_clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
518518
self.possible_borrower.add(borrowed.local, lhs);
519519
},
520520
other => {
521-
if ContainsRegion.visit_ty(place.ty(&self.body.local_decls, self.cx.tcx).ty) == ControlFlow::CONTINUE {
521+
if ContainsRegion.visit_ty(place.ty(&self.body.local_decls, self.cx.tcx).ty).is_continue() {
522522
return;
523523
}
524524
rvalue_locals(other, |rhs| {
@@ -540,7 +540,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
540540
// If the call returns something with lifetimes,
541541
// let's conservatively assume the returned value contains lifetime of all the arguments.
542542
// For example, given `let y: Foo<'a> = foo(x)`, `y` is considered to be a possible borrower of `x`.
543-
if ContainsRegion.visit_ty(&self.body.local_decls[*dest].ty) == ControlFlow::CONTINUE {
543+
if ContainsRegion.visit_ty(&self.body.local_decls[*dest].ty).is_continue() {
544544
return;
545545
}
546546

0 commit comments

Comments
 (0)