-
Notifications
You must be signed in to change notification settings - Fork 4
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
Slicing API for Pointer
#84
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
SliceIndex did work!? That's awesome! You are damn good at this man. I'm still on mobile, out and about, but I'll look at it tonight, hopefully. |
Man, this language is awesome. This solves #42. We already have a way to get a token by index, this allows for the rest (splitting, ranging, etc). Moving forward, we can reference tokens by index or range if we ever add additional nice-to-have methods. #42 covered more than the range or being able to split at tokens. I'm going to split off a couple more tickets from it and reduce it down to simply being able to split at an index. |
Nope, it didn't! You weren't wrong about that remark, it's just that we're not actually meant to implement
I tend to agree, it's pretty neat I was able to express what I wanted with the trait system. |
Looking again I think |
Actually, I'm thinking about it all wrong. It's |
Follow up of some ideas in #42.
This is effectively an extension of the split methods that can slice and dice
Pointer
types without allocation, similar to howslice::get
works.We use token indices as the range bounds, which ensures that any valid bound produces a valid
&Pointer
as a result.This is not a breaking change.