Replace some BinaryInteger with an explicit generic parameter.

For compatibility with pre-Swift-5.7 language versions.
This commit is contained in:
Stephen Canon committed 2023-09-28 15:31:25 -04:00
1 parent 470e4236ff
commit b3867a9155
2 files changed
+4 -4

No files matched your search

@@ -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<Count: BinaryInteger>(
leftBy count: Count,
rounding rule: RoundingRule = .down
) -> Self {
self.shiftedWithSaturation(leftBy: Int(clamping: count), rounding: rule)
@@ -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<Count: BinaryInteger>(
rightBy count: Count,
rounding rule: RoundingRule = .down
) -> Self {
self.shifted(rightBy: Int(clamping: count), rounding: rule)