Skip to content

Commit 118d327

Browse files
committed
Move cmp into the sorting closures
1 parent e3c03a5 commit 118d327

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
@@ -636,8 +636,8 @@ where
636636
where
637637
F: FnMut(&K, &V, &K, &V) -> Ordering,
638638
{
639-
self.with_entries(|entries| {
640-
entries.sort_by(|a, b| cmp(&a.key, &a.value, &b.key, &b.value));
639+
self.with_entries(move |entries| {
640+
entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value));
641641
});
642642
}
643643

@@ -650,7 +650,7 @@ where
650650
F: FnMut(&K, &V, &K, &V) -> Ordering,
651651
{
652652
let mut entries = self.into_entries();
653-
entries.sort_by(|a, b| cmp(&a.key, &a.value, &b.key, &b.value));
653+
entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value));
654654
IntoIter {
655655
iter: entries.into_iter(),
656656
}

0 commit comments

Comments
 (0)