GetSlice can now use both `usize` and `Option<usize>`
Created by: stratact
- Along with removing the now deprecated
OptionSlice
- Implemented the
AsOption
trait for converting eitherusize
orOption<usize>
toOption<usize>
(credit goes to @LazyOxen for writing out the functionality in the Rust Playpen)
So you can have your
The only downsides to doing this are:
- That you cannot do a
usize..Option<usize>
orOption<usize>..usize
because it's statically dispatched- So it must be either
usize..usize
orOption<usize>..Option<usize>
- So it must be either
- The
test!(array.get_slice(..) == &array);
test errors, because when using..
ranges,GetSlice
needs to know the type parameters explicitly and I didn't feel like with filling it in for now.
But other than that, I Feel Good!