From b3867a91551ca2bc35cc0201fc0fe6585f4dce07 Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Thu, 28 Sep 2023 15:31:25 -0400 Subject: [PATCH] Replace `some BinaryInteger` with an explicit generic parameter. For compatibility with pre-Swift-5.7 language versions. --- Sources/IntegerUtilities/SaturatingArithmetic.swift | 4 ++-- Sources/IntegerUtilities/ShiftWithRounding.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/IntegerUtilities/SaturatingArithmetic.swift b/Sources/IntegerUtilities/SaturatingArithmetic.swift index 08663e0..2d933f8 100644 --- a/Sources/IntegerUtilities/SaturatingArithmetic.swift +++ b/Sources/IntegerUtilities/SaturatingArithmetic.swift @@ -158,8 +158,8 @@ extension FixedWidthInteger { /// and if negative a right shift. /// - rounding rule: the direction in which to round if `count` is negative. @_transparent - public func shiftedWithSaturation( - leftBy count: some BinaryInteger, + public func shiftedWithSaturation( + leftBy count: Count, rounding rule: RoundingRule = .down ) -> Self { self.shiftedWithSaturation(leftBy: Int(clamping: count), rounding: rule) diff --git a/Sources/IntegerUtilities/ShiftWithRounding.swift b/Sources/IntegerUtilities/ShiftWithRounding.swift index 989a88f..d03bbae 100644 --- a/Sources/IntegerUtilities/ShiftWithRounding.swift +++ b/Sources/IntegerUtilities/ShiftWithRounding.swift @@ -188,8 +188,8 @@ extension BinaryInteger { /// a.shifted(rightBy: count, rounding: rule) /// a.divided(by: 1 << count, rounding: rule) @_transparent - public func shifted( - rightBy count: some BinaryInteger, + public func shifted( + rightBy count: Count, rounding rule: RoundingRule = .down ) -> Self { self.shifted(rightBy: Int(clamping: count), rounding: rule)