Skip to content

Commit

Permalink
Use ControlFlow::is{break,continue}
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed Oct 30, 2020
1 parent fa79cc4 commit 4a06145
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/redundant_clone.rs
Expand Up @@ -518,7 +518,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
self.possible_borrower.add(borrowed.local, lhs);
},
other => {
if ContainsRegion.visit_ty(place.ty(&self.body.local_decls, self.cx.tcx).ty) == ControlFlow::CONTINUE {
if ContainsRegion.visit_ty(place.ty(&self.body.local_decls, self.cx.tcx).ty).is_continue() {
return;
}
rvalue_locals(other, |rhs| {
Expand All @@ -540,7 +540,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
// If the call returns something with lifetimes,
// let's conservatively assume the returned value contains lifetime of all the arguments.
// For example, given `let y: Foo<'a> = foo(x)`, `y` is considered to be a possible borrower of `x`.
if ContainsRegion.visit_ty(&self.body.local_decls[*dest].ty) == ControlFlow::CONTINUE {
if ContainsRegion.visit_ty(&self.body.local_decls[*dest].ty).is_continue() {
return;
}

Expand Down

0 comments on commit 4a06145

Please sign in to comment.