Skip to content

Commit c8bbe0f

Browse files
committed
Move cmp into the sorting closures
1 parent 9354496 commit c8bbe0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@ where
568568
where
569569
F: FnMut(&K, &V, &K, &V) -> Ordering,
570570
{
571-
self.with_entries(|entries| {
572-
entries.sort_by(|a, b| cmp(&a.key, &a.value, &b.key, &b.value));
571+
self.with_entries(move |entries| {
572+
entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value));
573573
});
574574
}
575575

@@ -582,7 +582,7 @@ where
582582
F: FnMut(&K, &V, &K, &V) -> Ordering,
583583
{
584584
let mut entries = self.into_entries();
585-
entries.sort_by(|a, b| cmp(&a.key, &a.value, &b.key, &b.value));
585+
entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value));
586586
IntoIter {
587587
iter: entries.into_iter(),
588588
}

0 commit comments

Comments
 (0)