Merge pull request #271 from stephentyrone/none-some

Replace `some BinaryInteger` with an explicit generic parameter.
This commit is contained in:
Stephen Canon authored and GitHub committed 2023-09-29 14:34:06 -04:00
commit 182c9b246b
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)