Closed asmello closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.2%. Comparing base (
6630744
) to head (4e67712
).
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.
SliceIndex did work!? That's awesome! You are damn good at this man.
Nope, it didn't! You weren't wrong about that remark, it's just that we're not actually meant to implement SliceIndex
(it's even a sealed trait, for good reason). I introduced our own trait instead.
Man, this language is awesome.
I tend to agree, it's pretty neat I was able to express what I wanted with the trait system.
Looking again I think SlicePointer
is a bit awkward as a name, I meant it as "you slice a pointer with it", but that's probably not how most people will read it. PointerSlice
probably makes more sense. Will follow up with a quick rename before we release.
Actually, I'm thinking about it all wrong. It's SliceIndex
, so it should be PointerIndex
, duh.
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.