Skip to content

Commit 69b89fc

Browse files
committed
Add MemoryContError
1 parent 97b6018 commit 69b89fc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/error.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub enum LinalgError {
99
NotSquare(NotSquareError),
1010
Lapack(LapackError),
1111
Stride(StrideError),
12+
MemoryCont(MemoryContError),
1213
Shape(ShapeError),
1314
}
1415

@@ -70,3 +71,18 @@ impl error::Error for StrideError {
7071
"invalid stride"
7172
}
7273
}
74+
75+
#[derive(Debug)]
76+
pub struct MemoryContError {}
77+
78+
impl fmt::Display for MemoryContError {
79+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
80+
write!(f, "Memory is not contiguous")
81+
}
82+
}
83+
84+
impl error::Error for MemoryContError {
85+
fn description(&self) -> &str {
86+
"Memory is not contiguous"
87+
}
88+
}

0 commit comments

Comments
 (0)