From 38b5a2a67e64e8a02c4bee9bd0314e5023a559cb Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Wed, 21 Aug 2024 21:23:25 +0000 Subject: [PATCH] chore: Also format the control flow --- library/core/src/num/int_macros.rs | 8 ++++---- library/core/src/num/uint_macros.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index b22311da1e3..b48b05577c9 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1330,11 +1330,11 @@ macro_rules! int_impl { without modifying the original"] #[inline] pub const fn unbounded_shl(self, rhs: u32) -> $SelfT{ - if rhs < Self::BITS{ + if rhs < Self::BITS { // SAFETY: // rhs is just checked to be in-range above unsafe { self.unchecked_shl(rhs) } - }else{ + } else { 0 } } @@ -1457,11 +1457,11 @@ macro_rules! int_impl { without modifying the original"] #[inline] pub const fn unbounded_shr(self, rhs: u32) -> $SelfT{ - if rhs < Self::BITS{ + if rhs < Self::BITS { // SAFETY: // rhs is just checked to be in-range above unsafe { self.unchecked_shr(rhs) } - }else{ + } else { // A shift by `Self::BITS-1` suffices for signed integers, because the sign bit is copied for each of the shifted bits. // SAFETY: diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index b8ca299f67d..f09fd604dc6 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1519,11 +1519,11 @@ macro_rules! uint_impl { without modifying the original"] #[inline] pub const fn unbounded_shl(self, rhs: u32) -> $SelfT{ - if rhs < Self::BITS{ + if rhs < Self::BITS { // SAFETY: // rhs is just checked to be in-range above unsafe { self.unchecked_shl(rhs) } - }else{ + } else { 0 } } @@ -1644,11 +1644,11 @@ macro_rules! uint_impl { without modifying the original"] #[inline] pub const fn unbounded_shr(self, rhs: u32) -> $SelfT{ - if rhs < Self::BITS{ + if rhs < Self::BITS { // SAFETY: // rhs is just checked to be in-range above unsafe { self.unchecked_shr(rhs) } - }else{ + } else { 0 } }