diff --git a/src/matrix/addition.rs b/src/matrix/addition.rs deleted file mode 100644 index 3dfd291..0000000 --- a/src/matrix/addition.rs +++ /dev/null @@ -1,12 +0,0 @@ -use super::Matrix; -use std::ops::Add; - -impl Add for Matrix { - type Output = Matrix; - - fn add(self, other: Matrix) -> Matrix { - - - } - -} diff --git a/src/matrix/mod.rs b/src/matrix/mod.rs index 4cff922..b4a3052 100644 --- a/src/matrix/mod.rs +++ b/src/matrix/mod.rs @@ -42,7 +42,22 @@ impl Index<(usize, usize)> for Matrix { //Since it returns an Option, its not as simple as a get let row : Option<&Vec> = self.elements.get(index.0); //the 'T' in Option from get is a reference //Now, we need to unpack the Option - match row + match row { + // Lifetimes??? + + // Turbofish is used in expressions + Some(row) => { + //Within THIS match: + let column : Option<&i32> = row.get(index.1); + match column { + Some(entry) => Some(entry), + + None => &None, + } + + }, + None => &None, + } } }