Skip to content

Commit 033c4f2

Browse files
committed
just use an iterator
1 parent df233f0 commit 033c4f2

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
@@ -2250,9 +2250,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
22502250

22512251
// check for loan restricting path P being used. Accounts for
22522252
// borrows of P, P.a.b, etc.
2253-
let mut iter_incoming = flow_state.borrows.iter_incoming();
22542253
let borrow_set = self.borrow_set.clone();
2255-
while let Some(i) = iter_incoming.next() {
2254+
for i in flow_state.borrows.iter_incoming() {
22562255
let borrowed = &borrow_set[i];
22572256

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

0 commit comments

Comments
 (0)