Skip to content

Commit e69c60b

Browse files
committed
Just use ?
1 parent e5dd9c5 commit e69c60b

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

geo/src/algorithm/affine_ops.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,14 @@ impl<T: CoordNum + Neg> AffineTransform<T> {
303303
let inv_det = T::one() / determinant;
304304

305305
// If conversion of either the b or d matrix value fails, bail out
306-
match (T::from(-b * inv_det), T::from(-d * inv_det)) {
307-
(Some(inv_b), Some(inv_d)) => Some(Self::new(
308-
e * inv_det,
309-
inv_b,
310-
(b * yoff - e * xoff) * inv_det,
311-
inv_d,
312-
a * inv_det,
313-
(d * xoff - a * yoff) * inv_det,
314-
)),
315-
_ => None,
316-
}
306+
Some(Self::new(
307+
e * inv_det,
308+
T::from(-b * inv_det)?,
309+
(b * yoff - e * xoff) * inv_det,
310+
T::from(-d * inv_det)?,
311+
a * inv_det,
312+
(d * xoff - a * yoff) * inv_det,
313+
))
317314
}
318315
}
319316

0 commit comments

Comments
 (0)