Skip to content

Commit e12f572

Browse files
authored
fix: Use drain() instead of keys().next() + swap_remove() in auto_trait.rs
1 parent d242a8b commit e12f572

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/librustdoc/clean/auto_trait.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ fn clean_region_outlives_constraints<'tcx>(
280280
// `Region`s are encountered, we've computed a final constraint, and add it to our list.
281281
// Since we make sure to never re-add deleted items, this process will always finish.
282282
while !map.is_empty() {
283-
let target = *map.keys().next().unwrap();
284-
let deps = map.swap_remove(&target).unwrap();
283+
let (target, deps) = map.drain().next().unwrap();
285284

286285
for smaller in &deps.smaller {
287286
for larger in &deps.larger {

0 commit comments

Comments
 (0)