From bd1b825f3040b89f7d91ffde047955c7493100b5 Mon Sep 17 00:00:00 2001 From: binarycat Date: Tue, 11 Jun 2024 14:56:37 -0400 Subject: [PATCH] fix formatting --- src/sdl2/rect.rs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/sdl2/rect.rs b/src/sdl2/rect.rs index 81fdee985e..3f3264ddfd 100644 --- a/src/sdl2/rect.rs +++ b/src/sdl2/rect.rs @@ -4,11 +4,11 @@ use crate::sys; use std::convert::{AsMut, AsRef, TryFrom, TryInto}; use std::hash::{Hash, Hasher}; use std::mem; +use std::num::TryFromIntError; use std::ops::{ Add, AddAssign, BitAnd, BitOr, Deref, DerefMut, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign, }; -use std::num::TryFromIntError; use std::ptr; /// The maximal integer value that can be used for rectangles. @@ -709,17 +709,22 @@ impl From<(i32, i32, u32, u32)> for Rect { /// /// assert_eq!(rect1, rect2); /// ``` -impl TryFrom<[T; 4]> for Rect where - T: TryInto + TryInto, - // need to do this to support Infallible conversions - TryFromIntError: From<>::Error>, - TryFromIntError: From<>::Error>, +impl TryFrom<[T; 4]> for Rect +where + T: TryInto + TryInto, + // need to do this to support Infallible conversions + TryFromIntError: From<>::Error>, + TryFromIntError: From<>::Error>, { - type Error = TryFromIntError; - fn try_from([x, y, width, height]: [T; 4]) -> Result { - Ok(Rect::new(x.try_into()?, y.try_into()?, - width.try_into()?, height.try_into()?)) - } + type Error = TryFromIntError; + fn try_from([x, y, width, height]: [T; 4]) -> Result { + Ok(Rect::new( + x.try_into()?, + y.try_into()?, + width.try_into()?, + height.try_into()?, + )) + } } impl AsRef for Rect {