@@ -51,7 +51,6 @@ pub struct DenseMatrixMutView<'a, T: Debug + Display + Copy + Sized> {
51
51
column_major : bool ,
52
52
}
53
53
54
-
55
54
impl < ' a , T : Debug + Display + Copy + Sized > DenseMatrixView < ' a , T > {
56
55
fn new (
57
56
m : & ' a DenseMatrix < T > ,
@@ -60,7 +59,7 @@ impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixView<'a, T> {
60
59
) -> Result < Self , Failed > {
61
60
if m. is_valid_view ( m. shape ( ) . 0 , m. shape ( ) . 1 , & vrows, & vcols) {
62
61
Err ( Failed :: input (
63
- "The specified view is outside of the matrix range"
62
+ "The specified view is outside of the matrix range" ,
64
63
) )
65
64
} else {
66
65
let ( start, end, stride) =
@@ -112,7 +111,7 @@ impl<'a, T: Debug + Display + Copy + Sized> DenseMatrixMutView<'a, T> {
112
111
) -> Result < Self , Failed > {
113
112
if m. is_valid_view ( m. shape ( ) . 0 , m. shape ( ) . 1 , & vrows, & vcols) {
114
113
Err ( Failed :: input (
115
- "The specified view is outside of the matrix range"
114
+ "The specified view is outside of the matrix range" ,
116
115
) )
117
116
} else {
118
117
let ( start, end, stride) =
@@ -215,7 +214,7 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
215
214
pub fn from_2d_vec ( values : & Vec < Vec < T > > ) -> Result < Self , Failed > {
216
215
if values. is_empty ( ) || values[ 0 ] . is_empty ( ) {
217
216
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" ,
219
218
) )
220
219
} else {
221
220
let nrows = values. len ( ) ;
@@ -250,10 +249,13 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
250
249
vrows : & Range < usize > ,
251
250
vcols : & Range < usize > ,
252
251
) -> 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)
254
256
}
255
257
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
257
259
fn stride_range (
258
260
& self ,
259
261
n_rows : usize ,
@@ -277,7 +279,6 @@ impl<T: Debug + Display + Copy + Sized> DenseMatrix<T> {
277
279
} ;
278
280
( start, end, stride)
279
281
}
280
-
281
282
}
282
283
283
284
impl < T : Debug + Display + Copy + Sized > fmt:: Display for DenseMatrix < T > {
0 commit comments