Skip to content

Commit 0a377d5

Browse files
committed
linting
1 parent d4e9669 commit 0a377d5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/linalg/basic/matrix.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pub struct DenseMatrixMutView<'a, T: Debug + Display + Copy + Sized> {
5151
column_major: bool,
5252
}
5353

54-
5554
impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixView<'a, T> {
5655
fn new(
5756
m: &'a DenseMatrix<T>,
@@ -60,7 +59,7 @@ impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixView<'a, T> {
6059
) -> Result<Self, Failed> {
6160
if m.is_valid_view(m.shape().0, m.shape().1, &vrows, &vcols) {
6261
Err(Failed::input(
63-
"The specified view is outside of the matrix range"
62+
"The specified view is outside of the matrix range",
6463
))
6564
} else {
6665
let (start, end, stride) =
@@ -112,7 +111,7 @@ impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixMutView<'a, T> {
112111
) -> Result<Self, Failed> {
113112
if m.is_valid_view(m.shape().0, m.shape().1, &vrows, &vcols) {
114113
Err(Failed::input(
115-
"The specified view is outside of the matrix range"
114+
"The specified view is outside of the matrix range",
116115
))
117116
} else {
118117
let (start, end, stride) =
@@ -215,7 +214,7 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
215214
pub fn from_2d_vec(values: &Vec<Vec<T>>) -> Result<Self, Failed> {
216215
if values.is_empty() || values[0].is_empty() {
217216
Err(Failed::input(
218-
"The 2d vec provided is empty; cannot instantiate the matrix"
217+
"The 2d vec provided is empty; cannot instantiate the matrix",
219218
))
220219
} else {
221220
let nrows = values.len();
@@ -250,10 +249,13 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
250249
vrows: &Range<usize>,
251250
vcols: &Range<usize>,
252251
) -> bool {
253-
!(vrows.end <= n_rows && vcols.end <= n_cols && vrows.start <= n_rows && vcols.start <= n_cols)
252+
!(vrows.end <= n_rows
253+
&& vcols.end <= n_cols
254+
&& vrows.start <= n_rows
255+
&& vcols.start <= n_cols)
254256
}
255257

256-
/// Compute the range of the requested view: start, end, size of the slice
258+
/// Compute the range of the requested view: start, end, size of the slice
257259
fn stride_range(
258260
&self,
259261
n_rows: usize,
@@ -277,7 +279,6 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
277279
};
278280
(start, end, stride)
279281
}
280-
281282
}
282283

283284
impl<T: Debug + Display + Copy + Sized> fmt::Display for DenseMatrix<T> {

0 commit comments

Comments
 (0)