From 935f3899836397d623298289b7951e76da910d7d Mon Sep 17 00:00:00 2001 From: Norbert Nemec Date: Sat, 24 Aug 2019 21:06:31 +0200 Subject: [PATCH] replace deprecated try! macro by ? operator --- src/matrix.rs | 6 +++--- src/point.rs | 6 +++--- src/rotation.rs | 4 ++-- src/vector.rs | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index 8b50535..abaf861 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -1520,21 +1520,21 @@ impl From> for Quaternion { impl fmt::Debug for Matrix2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Matrix2 ")); + write!(f, "Matrix2 ")?; <[[S; 2]; 2] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Matrix3 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Matrix3 ")); + write!(f, "Matrix3 ")?; <[[S; 3]; 3] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Matrix4 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Matrix4 ")); + write!(f, "Matrix4 ")?; <[[S; 4]; 4] as fmt::Debug>::fmt(self.as_ref(), f) } } diff --git a/src/point.rs b/src/point.rs index 17d7bb7..d5aad79 100644 --- a/src/point.rs +++ b/src/point.rs @@ -370,21 +370,21 @@ impl_mint_conversions!(Point3 { x, y, z }, Point3); impl fmt::Debug for Point1 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Point1 ")); + write!(f, "Point1 ")?; <[S; 1] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Point2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Point2 ")); + write!(f, "Point2 ")?; <[S; 2] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Point3 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Point3 ")); + write!(f, "Point3 ")?; <[S; 3] as fmt::Debug>::fmt(self.as_ref(), f) } } diff --git a/src/rotation.rs b/src/rotation.rs index 86a6ea5..1949e1d 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -263,7 +263,7 @@ impl Rotation2 for Basis2 { impl fmt::Debug for Basis2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Basis2 ")); + write!(f, "Basis2 ")?; <[[S; 2]; 2] as fmt::Debug>::fmt(self.mat.as_ref(), f) } } @@ -445,7 +445,7 @@ where impl fmt::Debug for Basis3 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Basis3 ")); + write!(f, "Basis3 ")?; <[[S; 3]; 3] as fmt::Debug>::fmt(self.mat.as_ref(), f) } } diff --git a/src/vector.rs b/src/vector.rs index 0c758aa..9d35811 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -840,28 +840,28 @@ impl InnerSpace for Vector4 { impl fmt::Debug for Vector1 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Vector1 ")); + write!(f, "Vector1 ")?; <[S; 1] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Vector2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Vector2 ")); + write!(f, "Vector2 ")?; <[S; 2] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Vector3 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Vector3 ")); + write!(f, "Vector3 ")?; <[S; 3] as fmt::Debug>::fmt(self.as_ref(), f) } } impl fmt::Debug for Vector4 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, "Vector4 ")); + write!(f, "Vector4 ")?; <[S; 4] as fmt::Debug>::fmt(self.as_ref(), f) } }