diff --git a/Sources/Future/RawSpan.swift b/Sources/Future/RawSpan.swift index 25d7574e..efeac940 100644 --- a/Sources/Future/RawSpan.swift +++ b/Sources/Future/RawSpan.swift @@ -184,7 +184,7 @@ extension RawSpan { @inlinable @inline(__always) public func extracting(_ bounds: Range) -> Self { assertValidity(bounds) - return extracting(uncheckedBounds: bounds) + return extracting(unchecked: bounds) } /// Constructs a new span over the bytes within the supplied range of @@ -203,7 +203,7 @@ extension RawSpan { /// /// - Complexity: O(1) @inlinable @inline(__always) - public func extracting(uncheckedBounds bounds: Range) -> Self { + public func extracting(unchecked bounds: Range) -> Self { RawSpan( _unchecked: _start.advanced(by: bounds.lowerBound), byteCount: bounds.count, @@ -246,9 +246,9 @@ extension RawSpan { /// - Complexity: O(1) @_alwaysEmitIntoClient public func extracting( - uncheckedBounds bounds: some RangeExpression + unchecked bounds: some RangeExpression ) -> Self { - extracting(uncheckedBounds: bounds.relative(to: _byteOffsets)) + extracting(unchecked: bounds.relative(to: _byteOffsets)) } /// Constructs a new span over all the bytes of this span. diff --git a/Sources/Future/Span.swift b/Sources/Future/Span.swift index 67ff7ae5..b7859ddd 100644 --- a/Sources/Future/Span.swift +++ b/Sources/Future/Span.swift @@ -423,7 +423,7 @@ extension Span where Element: ~Copyable /*& ~Escapable*/ { @inlinable @inline(__always) public func extracting(_ bounds: Range) -> Self { assertValidity(bounds) - return extracting(uncheckedBounds: bounds) + return extracting(unchecked: bounds) } /// Constructs a new span over the items within the supplied range of @@ -442,7 +442,7 @@ extension Span where Element: ~Copyable /*& ~Escapable*/ { /// /// - Complexity: O(1) @inlinable @inline(__always) - public func extracting(uncheckedBounds bounds: Range) -> Self { + public func extracting(unchecked bounds: Range) -> Self { Span( _unchecked: _start.advanced(by: bounds.lowerBound), count: bounds.count, @@ -487,7 +487,7 @@ extension Span where Element: ~Copyable /*& ~Escapable*/ { public func extracting( uncheckedBounds bounds: some RangeExpression ) -> Self { - extracting(uncheckedBounds: bounds.relative(to: _indices)) + extracting(unchecked: bounds.relative(to: _indices)) } /// Constructs a new span over all the items of this span. diff --git a/Tests/FutureTests/RawSpanTests.swift b/Tests/FutureTests/RawSpanTests.swift index f4c2615b..4d0a17eb 100644 --- a/Tests/FutureTests/RawSpanTests.swift +++ b/Tests/FutureTests/RawSpanTests.swift @@ -104,7 +104,7 @@ final class RawSpanTests: XCTestCase { let sub1 = span.extracting(0..<2) let sub2 = span.extracting(..<2) let sub3 = span.extracting(...) - let sub4 = span.extracting(uncheckedBounds: 2...) + let sub4 = span.extracting(unchecked: 2...) XCTAssertTrue( sub1.unsafeView(as: UInt8.self)._elementsEqual(sub2.unsafeView(as: UInt8.self)) ) @@ -123,7 +123,7 @@ final class RawSpanTests: XCTestCase { b.withUnsafeBytes { let span = RawSpan(unsafeBytes: $0, owner: $0) let prefix = span.extracting(0..<8) - let beyond = prefix.extracting(uncheckedBounds: 16..<24) + let beyond = prefix.extracting(unchecked: 16..<24) XCTAssertEqual(beyond.byteCount, 8) XCTAssertEqual(beyond.unsafeLoad(as: UInt8.self), 16) }