Skip to content

Commit 62262ea

Browse files
committed
Move retain fully into the core
1 parent e295a57 commit 62262ea

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/map.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,7 @@ where
526526
where
527527
F: FnMut(&mut K, &mut V) -> bool,
528528
{
529-
dispatch_32_vs_64!(self.retain_mut_sz::<_>(keep));
530-
}
531-
532-
fn retain_mut_sz<Sz, F>(&mut self, keep: F)
533-
where
534-
F: FnMut(&mut K, &mut V) -> bool,
535-
Sz: Size,
536-
{
537-
self.core.retain_in_order_impl::<Sz, F>(keep);
529+
self.core.retain_in_order(keep);
538530
}
539531

540532
/// Sort the map’s key-value pairs by the default ordering of the keys.

src/map_core.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,14 @@ impl<K, V> IndexMapCore<K, V> {
745745
});
746746
}
747747

748-
pub(crate) fn retain_in_order_impl<Sz, F>(&mut self, mut keep: F)
748+
pub(crate) fn retain_in_order<F>(&mut self, keep: F)
749+
where
750+
F: FnMut(&mut K, &mut V) -> bool,
751+
{
752+
dispatch_32_vs_64!(self.retain_in_order_impl::<_>(keep));
753+
}
754+
755+
fn retain_in_order_impl<Sz, F>(&mut self, mut keep: F)
749756
where
750757
F: FnMut(&mut K, &mut V) -> bool,
751758
Sz: Size,

0 commit comments

Comments
 (0)