image icon indicating copy to clipboard operation
image copied to clipboard

`RowsMut`, `Rows`, `Pixels`, `PixelsMut` should implement accessor

Open 197g opened this issue 5 years ago • 2 comments

RowsMut and Rows should implement accessor slices similar to the internal chunks.

Draft

impl<T> Rows<T> {
    pub fn as_slice(&self) -> &[T::Subpixel];
}

197g avatar Aug 25 '20 20:08 197g

I mistakenly assumed that slice::Chunks would have these methods similar to slice::Iter have them. However, that is not the case. Implementing this would therefore require us to store another reference to the complete slice or even harder for the mutable case. I'm marking this with dependency.

197g avatar Aug 29 '20 19:08 197g

Seems not so popular and std hasn't added these implementations in 5 years. I'll leave it open as a reminder to do an ACP and PR to rustc but this will probably be closed.

197g avatar Aug 08 '25 14:08 197g