Skip to content

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jul 24, 2020

Rather than just RangeFull, this lets us accept any Range* type or
even arbitrary Bound pairs, matching the signature of Vec::drain.

Rather than just `RangeFull`, this lets us accept any `Range*` type or
even arbitrary `Bound` pairs, matching the signature of `Vec::drain`.
@@ -10,3 +11,29 @@ where
{
iterable.into_iter().enumerate()
}

pub(crate) fn simplify_range<R>(range: R, len: usize) -> Range<usize>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will also be useful for #104.

@cuviper
Copy link
Member Author

cuviper commented Aug 7, 2020

I'm going to go ahead and merge this -- the signature should be uncontroversial to match Vec, and it's not a breaking change since we still accept RangeFull as a possibility. We can always iterate on the implementation more later, if needed.

@cuviper cuviper merged commit 8ddc4f1 into indexmap-rs:master Aug 7, 2020
@cuviper cuviper deleted the drain-ranges branch July 18, 2023 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant