Skip to content

Commit 4ef0c11

Browse files
committed
just use an iterator
1 parent 6e242be commit 4ef0c11

File tree

1 file changed

+1
-2
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+1
-2
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,9 +2194,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
21942194

21952195
// check for loan restricting path P being used. Accounts for
21962196
// borrows of P, P.a.b, etc.
2197-
let mut iter_incoming = flow_state.borrows.iter_incoming();
21982197
let borrow_set = self.borrow_set.clone();
2199-
while let Some(i) = iter_incoming.next() {
2198+
for i in flow_state.borrows.iter_incoming() {
22002199
let borrowed = &borrow_set[i];
22012200

22022201
if self.places_conflict(&borrowed.borrowed_place, place, access) {

0 commit comments

Comments
 (0)