rust/vec2d/src/lib.rs
changeset 13924 a140f28decc4
parent 13916 cd437d76978a
child 13930 5c9d963492bf
--- a/rust/vec2d/src/lib.rs	Mon Oct 15 22:22:51 2018 +0300
+++ b/rust/vec2d/src/lib.rs	Mon Oct 15 23:10:03 2018 +0200
@@ -54,6 +54,11 @@
     pub fn get_mut(&mut self, row: usize, column: usize) -> Option<&mut <usize as SliceIndex<[T]>>::Output> {
         self.data.get_mut(row * self.width + column)
     }
+
+    #[inline]
+    pub fn get(&self, row: usize, column: usize) -> Option<&<usize as SliceIndex<[T]>>::Output> {
+        self.data.get(row * self.width + column)
+    }
 }
 
 #[cfg(test)]