ralexstokes / ssz-rs

Implementation of ethereum's `ssz`
Apache License 2.0
102 stars 40 forks source link

use more permissive index type for {Vector, List}::index_mut #105

Closed ralexstokes closed 1 year ago

ralexstokes commented 1 year ago

the index_mut implementation should also support index types other than usize to support batch editing operations ("copy N bytes into these N bytes of the source")

the existing implementation restricted the index type to just usize so that this information could be used to inform caching strategies

this PR relaxes the constraint for now, with the caveat that we will likely need to constrain the implementation a bit so we can actually get the indexing data during a call to index_mut (e.g. only allow index_mut for usize and the Range family of index types) so we can concretely get the actual indexes mutated