My main inspiration is https://github.com/image-rs/image/issues/2259, where the current image pixel types use an internal array like: struct Rgb<T>([T;3]) and also implement Index<usize> and IndexMutso if thergb` crates types also implemented those traits then the migration process would be easier.
On the other hand, using the field access (.r, .g, .b) seems much more readable to me so perhaps we shouldn't implement Index<usize> and instead refactor the image crate to field access when doing the migration.
My main inspiration is https://github.com/image-rs/image/issues/2259, where the current
image
pixel types use an internal array like:struct Rgb<T>([T;3])
and also implementIndex<usize>
and IndexMutso if the
rgb` crates types also implemented those traits then the migration process would be easier.On the other hand, using the field access (
.r
,.g
,.b
) seems much more readable to me so perhaps we shouldn't implementIndex<usize>
and instead refactor theimage
crate to field access when doing the migration.