only solution i found so far is to use an array of size two [start, end], or a struct with two members {start: usize, end: usize}.
both are somewhat ok, but not as convenient to use.
The .. and ... tokens aren’t ‘real’ operators. They don’t produce a value. Outside of the places where they’re valid syntax (loops, switches, arrays, slices), they don’t compile. So no, there’s no way to do that.
There’s lots of ways you could approach it if you want more type safety, but the two methods you’ve already found are pretty much what you get if you want a single range parameter.
But why not just pass two parameters and assert that they’re a valid range?
But why not just pass two parameters and assert that they’re a valid range?
i find it more consistent and thus readable if i can index custom types the same way as i would an array or slice.
oh well, i will make do with a struct.