Skip to content

Commit 182c9b2

Browse files
Merge pull request #271 from stephentyrone/none-some
Replace `some BinaryInteger` with an explicit generic parameter.
2 parents 470e423 + b3867a9 commit 182c9b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/IntegerUtilities/SaturatingArithmetic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ extension FixedWidthInteger {
158158
/// and if negative a right shift.
159159
/// - rounding rule: the direction in which to round if `count` is negative.
160160
@_transparent
161-
public func shiftedWithSaturation(
162-
leftBy count: some BinaryInteger,
161+
public func shiftedWithSaturation<Count: BinaryInteger>(
162+
leftBy count: Count,
163163
rounding rule: RoundingRule = .down
164164
) -> Self {
165165
self.shiftedWithSaturation(leftBy: Int(clamping: count), rounding: rule)

Sources/IntegerUtilities/ShiftWithRounding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ extension BinaryInteger {
188188
/// a.shifted(rightBy: count, rounding: rule)
189189
/// a.divided(by: 1 << count, rounding: rule)
190190
@_transparent
191-
public func shifted(
192-
rightBy count: some BinaryInteger,
191+
public func shifted<Count: BinaryInteger>(
192+
rightBy count: Count,
193193
rounding rule: RoundingRule = .down
194194
) -> Self {
195195
self.shifted(rightBy: Int(clamping: count), rounding: rule)

0 commit comments

Comments
 (0)