Skip to content

Commit

Permalink
Mark BinaryInteger.init(clamping:) as borrowing (#92).
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Oct 9, 2024
1 parent d6627da commit 5553317
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/CoreKit/BinaryInteger+Clamping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ extension BinaryInteger {
//=------------------------------------------------------------------------=

/// Creates a new instance by clamping the given `source`.
@inlinable public init(clamping source: /*borrowing*/ some FiniteInteger) {
@inlinable public init(clamping source: borrowing some FiniteInteger) {
self.init(clamping: source)!
}

/// Creates a new instance by clamping the given `source`.
@_disfavoredOverload // BinaryInteger.init(clamping: some FiniteInteger)
@inlinable public init(clamping source: /*borrowing*/ some BinaryInteger) where Self: EdgyInteger {
@inlinable public init(clamping source: borrowing some BinaryInteger) where Self: EdgyInteger {
self.init(clamping: source)!
}

Expand All @@ -43,7 +43,7 @@ extension BinaryInteger {
/// - Note: This is the most generic version of `init(clamping:)`.
///
@_disfavoredOverload // BinaryInteger.init(clamping: some FiniteInteger)
@inlinable public init?(clamping source: /*borrowing*/ some BinaryInteger) {
@inlinable public init?(clamping source: borrowing some BinaryInteger) {
if Self.isArbitrary {

if Self.isSigned, source.isInfinite {
Expand Down

0 comments on commit 5553317

Please sign in to comment.