We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3db4afd + fde59a8 commit 3c50257Copy full SHA for 3c50257
compiler/rustc_typeck/src/check/upvar.rs
@@ -1382,14 +1382,8 @@ fn determine_place_ancestry_relation(
1382
// Assume of length of projections_b = m
1383
let projections_b = &place_b.projections;
1384
1385
- let mut same_initial_projections = true;
1386
-
1387
- for (proj_a, proj_b) in projections_a.iter().zip(projections_b.iter()) {
1388
- if proj_a != proj_b {
1389
- same_initial_projections = false;
1390
- break;
1391
- }
1392
+ let same_initial_projections =
+ projections_a.iter().zip(projections_b.iter()).all(|(proj_a, proj_b)| proj_a == proj_b);
1393
1394
if same_initial_projections {
1395
// First min(n, m) projections are the same
0 commit comments