diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-12-05 21:07:42 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-01-14 12:43:51 -0800 |
| commit | a78d9a6de1848358b3835d3ac8ce6b20a24c061f (patch) | |
| tree | adc1df97e00dbc9be055dbeaad4292de430ba846 | |
| parent | 81e1a7c6b5bb5bea9fbbd0f5db0c118dbea867fb (diff) | |
| download | rust-a78d9a6de1848358b3835d3ac8ce6b20a24c061f.tar.gz rust-a78d9a6de1848358b3835d3ac8ce6b20a24c061f.zip | |
Unindent nonzero_integer_impl_div_rem macro body
| -rw-r--r-- | library/core/src/num/nonzero.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 79cca276479..75429d9059a 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -283,30 +283,30 @@ macro_rules! nonzero_integer_impl_div_rem { }; ($Ty:ident unsigned $Int:ty) => { - #[stable(feature = "nonzero_div", since = "1.51.0")] - impl Div<$Ty> for $Int { - type Output = $Int; - /// This operation rounds towards zero, - /// truncating any fractional part of the exact result, and cannot panic. - #[inline] - fn div(self, other: $Ty) -> $Int { - // SAFETY: div by zero is checked because `other` is a nonzero, - // and MIN/-1 is checked because `self` is an unsigned int. - unsafe { crate::intrinsics::unchecked_div(self, other.get()) } - } + #[stable(feature = "nonzero_div", since = "1.51.0")] + impl Div<$Ty> for $Int { + type Output = $Int; + /// This operation rounds towards zero, + /// truncating any fractional part of the exact result, and cannot panic. + #[inline] + fn div(self, other: $Ty) -> $Int { + // SAFETY: div by zero is checked because `other` is a nonzero, + // and MIN/-1 is checked because `self` is an unsigned int. + unsafe { crate::intrinsics::unchecked_div(self, other.get()) } } + } - #[stable(feature = "nonzero_div", since = "1.51.0")] - impl Rem<$Ty> for $Int { - type Output = $Int; - /// This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. - #[inline] - fn rem(self, other: $Ty) -> $Int { - // SAFETY: rem by zero is checked because `other` is a nonzero, - // and MIN/-1 is checked because `self` is an unsigned int. - unsafe { crate::intrinsics::unchecked_rem(self, other.get()) } - } + #[stable(feature = "nonzero_div", since = "1.51.0")] + impl Rem<$Ty> for $Int { + type Output = $Int; + /// This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. + #[inline] + fn rem(self, other: $Ty) -> $Int { + // SAFETY: rem by zero is checked because `other` is a nonzero, + // and MIN/-1 is checked because `self` is an unsigned int. + unsafe { crate::intrinsics::unchecked_rem(self, other.get()) } } + } }; } |
