-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DoubleEndedIterator
implementation for Segments
#2535
Labels
Comments
I'm not opposed to this, but the implementation would require great care. The inherent methods on |
SergioBenitez
added
accepted
An accepted request or suggestion
suggestion
A suggestion to change functionality
and removed
suggestion
A suggestion to change functionality
labels
May 6, 2023
Can I work on it? |
Yes, please feel free! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Existing Functionality
Currently there is only a forward iterator for
Segments
even though it is backed by a known size slice.https://github.com/SergioBenitez/Rocket/blob/f1f533c1e5b0df5b44877d7cca39fb0f596a21b6/core/http/src/uri/segments.rs#L279-L295
Suggested Changes
Add a
DoubleEndedIterator
implementation toSegments
to allow for iterating path segments in reverse for example, if be necessary.Alternatives Considered
Collecting into a Vec and iterating in reverse is inefficient and for-i is just ugly and doesn't give clean flexibility.
The text was updated successfully, but these errors were encountered: