Skip to content

Commit de16415

Browse files
committed
refactoring
1 parent cb5675c commit de16415

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/ndarrayext.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ pub fn to_2d<'a, T: 'a, D, I>(data: I, axis: Axis) -> Result<ArrayView2<'a, T>>
6767
Err(error) => Err(
6868
ReshapeError(
6969
format!("Cannot reshape {}-d array with shape {:?} by axis {} \
70-
to 2-d array with shape {:?}. Error: {}",
71-
ndim, shape, axis.0, new_shape, error)
70+
to 2-d array with shape {:?}. Error: {}", ndim, shape, axis.0, new_shape, error)
7271
)
7372
)
7473
}
@@ -85,14 +84,12 @@ pub fn to_2d_simple<'a, T: 'a, D>(data: ArrayView<'a, T, D>) -> Result<ArrayView
8584

8685
match data.into_shape(new_shape) {
8786
Ok(data_2d) => Ok(data_2d),
88-
Err(err) => {
89-
return Err(
90-
ReshapeError(
91-
format!("Cannot reshape {}-d array with shape {:?} to 2-d array with \
87+
Err(err) => Err(
88+
ReshapeError(
89+
format!("Cannot reshape {}-d array with shape {:?} to 2-d array with \
9290
shape {:?}. Error: {}", ndim, shape, new_shape, err)
93-
)
9491
)
95-
}
92+
)
9693
}
9794
}
9895

0 commit comments

Comments
 (0)