Skip to content

Commit

Permalink
Merge pull request #1358 from HeroicKatora/fix-mutability-provenance-…
Browse files Browse the repository at this point in the history
…of-pixels

Fix assembling mutable slice from const reference
  • Loading branch information
HeroicKatora committed Nov 12, 2020
2 parents 1ec76c9 + 5cbe1e6 commit e0261ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/color.rs
Expand Up @@ -253,7 +253,7 @@ impl<T: Primitive + 'static> Pixel for $ident<T> {
}
fn from_slice_mut(slice: &mut [T]) -> &mut $ident<T> {
assert_eq!(slice.len(), $channels);
unsafe { &mut *(slice.as_ptr() as *mut $ident<T>) }
unsafe { &mut *(slice.as_mut_ptr() as *mut $ident<T>) }
}

fn to_rgb(&self) -> Rgb<T> {
Expand Down

0 comments on commit e0261ce

Please sign in to comment.