Skip to content

Commit 2e01a25

Browse files
committed
[stdlib] use a primary associated type
1 parent 7f4caed commit 2e01a25

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

stdlib/public/core/UnsafeBufferPointerSlice.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
2626
/// be less than or equal to this buffer slice's `count`.
2727
@inlinable
2828
@_alwaysEmitIntoClient
29-
public func copyBytes<C: Collection>(
30-
from source: C
31-
) where C.Element == UInt8 {
29+
public func copyBytes(from source: some Collection<UInt8>) {
3230
let buffer = Base(rebasing: self)
3331
buffer.copyBytes(from: source)
3432
}

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,7 @@ extension Unsafe${Mutable}RawBufferPointer {
534534
/// - Parameter source: A collection of `UInt8` elements. `source.count` must
535535
/// be less than or equal to this buffer's `count`.
536536
@inlinable
537-
public func copyBytes<C: Collection>(
538-
from source: C
539-
) where C.Element == UInt8 {
537+
public func copyBytes(from source: some Collection<UInt8>) {
540538
guard let position = _position else {
541539
return
542540
}

0 commit comments

Comments
 (0)