--- 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<T> IndexMut<usize> for Land2D<T> {
+ #[inline]
+ fn index_mut(&mut self, row: usize) -> &mut [T] {
+ &mut self.pixels[row]
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;