Skip to content

Commit b505c7a

Browse files
remove typed throws as they don't yet support typed rethrows
1 parent 1946204 commit b505c7a

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Sources/VariableLengthArray/Joined.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ extension VLArray {
1313
}
1414

1515
@inlinable
16-
public static func create<E: Error, let count: Int>(
16+
public static func create<let count: Int>(
1717
_ elements: borrowing InlineArray<count, VLArray<Element>>,
18-
closure: (inout Self) throws(E) -> Void
18+
closure: (inout Self) throws -> Void
1919
) rethrows {
2020
try withUnsafeTemporaryAllocation(of: UnsafeMutableBufferPointer<Element>.self, capacity: elements.count, { pointer in
2121
for i in elements.indices {
@@ -110,8 +110,8 @@ extension VLArray {
110110
}
111111

112112
@inlinable
113-
public func forEachElement<E: Error>(
114-
_ yielding: (Element) throws(E) -> Void
113+
public func forEachElement(
114+
_ yielding: (Element) throws -> Void
115115
) rethrows {
116116
for i in _storage.indices {
117117
let buffer = _storage[i]

Sources/VariableLengthArray/VLArray.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ extension VLArray where Element: ~Copyable {
191191
extension VLArray {
192192
@discardableResult
193193
@inlinable
194-
public static func create<E: Error, T>(
194+
public static func create<T>(
195195
amount: Int,
196196
default: Element,
197-
_ closure: (consuming Self) throws(E) -> T
197+
_ closure: (consuming Self) throws -> T
198198
) rethrows -> T {
199199
return try withUnsafeTemporaryAllocation(of: Element.self, capacity: amount, { p in
200200
p.initialize(repeating: `default`)
@@ -208,10 +208,10 @@ extension VLArray {
208208

209209
@discardableResult
210210
@inlinable
211-
public static func create<E: Error, T>(
211+
public static func create<T>(
212212
amount: Int,
213213
initialize: (Index) -> Element,
214-
_ closure: (consuming Self) throws(E) -> T
214+
_ closure: (consuming Self) throws -> T
215215
) rethrows -> T {
216216
return try withUnsafeTemporaryAllocation(of: Element.self, capacity: amount, { p in
217217
for i in 0..<amount {
@@ -230,10 +230,10 @@ extension VLArray {
230230
extension VLArray where Element: ~Copyable {
231231
@discardableResult
232232
@inlinable
233-
public static func create<E: Error, T>(
233+
public static func create<T>(
234234
amount: Int,
235235
initialize: (Index) -> Element,
236-
_ closure: (consuming Self) throws(E) -> T
236+
_ closure: (consuming Self) throws -> T
237237
) rethrows -> T {
238238
return try withUnsafeTemporaryAllocation(of: Element.self, capacity: amount, { p in
239239
for i in 0..<amount {
@@ -253,9 +253,9 @@ extension VLArray where Element == UInt8 {
253253

254254
@discardableResult
255255
@inlinable
256-
public static func create<E: Error, T>(
256+
public static func create<T>(
257257
string: StaticString,
258-
_ closure: (consuming Self) throws(E) -> T
258+
_ closure: (consuming Self) throws -> T
259259
) rethrows -> T {
260260
return try withUnsafeTemporaryAllocation(of: Element.self, capacity: string.utf8CodeUnitCount, { p in
261261
string.withUTF8Buffer {
@@ -271,9 +271,9 @@ extension VLArray where Element == UInt8 {
271271

272272
@discardableResult
273273
@inlinable
274-
public static func create<E: Error, T>(
274+
public static func create<T>(
275275
string: some StringProtocol,
276-
_ closure: (consuming Self) throws(E) -> T
276+
_ closure: (consuming Self) throws -> T
277277
) rethrows -> T {
278278
let utf8 = string.utf8
279279
return try withUnsafeTemporaryAllocation(of: Element.self, capacity: utf8.count, { p in
@@ -288,9 +288,9 @@ extension VLArray where Element == UInt8 {
288288

289289
@discardableResult
290290
@inlinable
291-
public static func create<E: Error, T>(
291+
public static func create<T>(
292292
collection: some Collection<UInt8>,
293-
_ closure: (consuming Self) throws(E) -> T
293+
_ closure: (consuming Self) throws -> T
294294
) rethrows -> T {
295295
let count = collection.count
296296
return try withUnsafeTemporaryAllocation(
@@ -311,9 +311,9 @@ extension VLArray where Element == UInt8 {
311311
#if compiler(>=6.2)
312312
extension VLArray {
313313
@inlinable
314-
public func join<let count: Int, E: Error>(
314+
public func join<let count: Int>(
315315
_ arrays: consuming InlineArray<count, VLArray>,
316-
_ closure: (inout Joined) throws(E) -> Void
316+
_ closure: (inout Joined) throws -> Void
317317
) rethrows {
318318
try withUnsafeTemporaryAllocation(
319319
of: UnsafeMutableBufferPointer<Element>.self,

0 commit comments

Comments
 (0)