1
Fork 0

Allow SliceIndex to be indexed by ranges.

This commit is contained in:
Jason Newcomb 2025-02-21 16:01:19 -05:00
parent a74f3fb5fc
commit 162fb713ac
10 changed files with 121 additions and 22 deletions

View file

@ -147,7 +147,7 @@ impl<I: Idx, K: Ord, V> FromIterator<(K, V)> for SortedIndexMultiMap<I, K, V> {
where
J: IntoIterator<Item = (K, V)>,
{
let items = IndexVec::from_iter(iter);
let items = IndexVec::<I, _>::from_iter(iter);
let mut idx_sorted_by_item_key: Vec<_> = items.indices().collect();
// `sort_by_key` is stable, so insertion order is preserved for duplicate items.