diff -r 128ace913837 -r f39f0f614dbf rust/land2d/src/lib.rs --- a/rust/land2d/src/lib.rs Mon Jan 02 15:59:26 2023 +0100 +++ b/rust/land2d/src/lib.rs Tue Jan 03 12:05:59 2023 +0100 @@ -1,4 +1,4 @@ -use std::{cmp, ops::Index}; +use std::{cmp, ops::Index, ops::IndexMut}; use integral_geometry::{ArcPoints, EquidistantPoints, Line, Point, PotSize, Rect, Size, SizeMask}; @@ -288,6 +288,13 @@ } } +impl IndexMut for Land2D { + #[inline] + fn index_mut(&mut self, row: usize) -> &mut [T] { + &mut self.pixels[row] + } +} + #[cfg(test)] mod tests { use super::*;