Skip to content

Commit cd286fa

Browse files
committed
Added from_parts_with_err method to Array
Signed-off-by: chandr-andr (Kiselev Aleksandr) <chandr@chandr.net>
1 parent c32f38e commit cd286fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ impl<T> Array<T> {
8484
data: Vec<T>,
8585
dimensions: Vec<Dimension>,
8686
) -> Result<Array<T>, Error> {
87-
if (data.is_empty() && dimensions.is_empty())
88-
|| data.len() as i32 == dimensions.iter().fold(1, |acc, i| acc * i.len)
87+
if !(data.is_empty() && dimensions.is_empty())
88+
|| data.len() as i32 != dimensions.iter().fold(1, |acc, i| acc * i.len)
8989
{
9090
return Err(Error::new(ErrorKind::Other, "size mismatch"));
9191
}

0 commit comments

Comments
 (0)