Skip to content

Commit b2f2620

Browse files
committed
Plugin, StopTheLine, Retrier are Actor now
1 parent 64f4114 commit b2f2620

File tree

62 files changed

+670
-889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+670
-889
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @NikSativa

.github/workflows/swift_macos.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,10 @@ on:
1818
- "Tests/**"
1919

2020
concurrency:
21-
group: ${{ github.ref_name }}
21+
group: ${{ github.workflow }}-${{ github.ref_name }}
2222
cancel-in-progress: true
23+
2324
jobs:
24-
macOS:
25-
name: "macOS ${{ matrix.xcode }} ${{ matrix.swift }}"
26-
runs-on: ${{ matrix.runsOn }}
27-
env:
28-
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
29-
timeout-minutes: 10
30-
strategy:
31-
fail-fast: false
32-
matrix:
33-
include:
34-
- xcode: "Xcode_16.3"
35-
runsOn: macOS-15
36-
swift: "6.1"
37-
outputFilter: xcbeautify --renderer github-actions
38-
- xcode: "Xcode_16.0"
39-
runsOn: macOS-15
40-
swift: "6.0"
41-
outputFilter: xcbeautify --renderer github-actions
42-
- xcode: "Xcode_15.4"
43-
runsOn: macOS-14
44-
swift: "5.10"
45-
outputFilter: xcbeautify --renderer github-actions
46-
- xcode: "Xcode_15.2"
47-
runsOn: macOS-14
48-
swift: "5.9"
49-
outputFilter: xcbeautify --renderer github-actions
50-
steps:
51-
- uses: swift-actions/setup-swift@v2
52-
with:
53-
swift-version: ${{ matrix.swift }}
54-
- uses: actions/checkout@v4
55-
- name: "Build ${{ matrix.xcode }} ${{ matrix.swift }}"
56-
run: swift build -v | ${{ matrix.outputFilter }}
57-
- name: "Test ${{ matrix.xcode }} ${{ matrix.swift }}"
58-
run: swift test -v | ${{ matrix.outputFilter }}
25+
ci:
26+
uses: NikSativa/.github/.github/workflows/swift_macos_reusable.yml@main
27+
secrets: inherit
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22
// swiftformat:disable all
33
import PackageDescription
44

Source/Address/SmartURL.swift

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import Foundation
22

3-
/// Deprecated alias for ``SmartURL``.
4-
@available(*, deprecated, renamed: "SmartURL", message: "Please use SmartURL instead.")
5-
public typealias Address = SmartURL
6-
73
/// Encapsulates flexible construction of URLs from various source types.
84
///
95
/// `SmartURL` supports initialization from raw strings, `URL`, `URLComponents`, or custom `SmartUrlComponents`.
@@ -25,16 +21,16 @@ public enum SmartURL: Hashable, SmartSendable {
2521
/// - Throws: `RequestEncodingError.brokenURL` or similar if the URL cannot be formed.
2622
public func url() throws -> URL {
2723
switch self {
28-
case .url(let url):
24+
case let .url(url):
2925
return url
3026

31-
case .string(let str):
27+
case let .string(str):
3228
return try URL(string: str).unwrap(orThrow: RequestEncodingError.brokenURL)
3329

34-
case .components(let components):
30+
case let .components(components):
3531
return try components.url.unwrap(orThrow: RequestEncodingError.brokenURL)
3632

37-
case .smartComponents(let components, let shouldAddSlashAfterEndpoint, let shouldRemoveSlashesForEmptyScheme):
33+
case let .smartComponents(components, shouldAddSlashAfterEndpoint, shouldRemoveSlashesForEmptyScheme):
3834
return try components.url(shouldAddSlashAfterEndpoint: shouldAddSlashAfterEndpoint,
3935
shouldRemoveSlashesForEmptyScheme: shouldRemoveSlashesForEmptyScheme)
4036
}
@@ -121,13 +117,13 @@ public extension SmartURL {
121117
}
122118

123119
switch self {
124-
case .url(let url):
120+
case let .url(url):
125121
return url.description
126-
case .string(let str):
122+
case let .string(str):
127123
return str
128-
case .components(let components):
124+
case let .components(components):
129125
return components.description
130-
case .smartComponents(let components, let shouldAddSlashAfterEndpoint, let shouldRemoveSlashesForEmptyScheme):
126+
case let .smartComponents(components, shouldAddSlashAfterEndpoint, shouldRemoveSlashesForEmptyScheme):
131127
return components.description + " shouldAddSlashAfterEndpoint: \(shouldAddSlashAfterEndpoint), shouldRemoveSlashesForEmptyScheme: \(shouldRemoveSlashesForEmptyScheme)"
132128
}
133129
}

Source/Address/SmartURLExt.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import Foundation
33
public extension SmartURL {
44
private func modify(_ modifier: (SmartUrlComponents) throws -> SmartUrlComponents) throws -> Self {
55
switch self {
6-
case .smartComponents(let components, let shouldAddSlashAfterEndpoint, let shouldRemoveSlashesForEmptyScheme):
6+
case let .smartComponents(components, shouldAddSlashAfterEndpoint, shouldRemoveSlashesForEmptyScheme):
77
return try .smartComponents(modifier(components), shouldAddSlashAfterEndpoint: shouldAddSlashAfterEndpoint, shouldRemoveSlashesForEmptyScheme: shouldRemoveSlashesForEmptyScheme)
88

9-
case .string(let str):
9+
case let .string(str):
1010
let components: SmartUrlComponents = try .init(string: str)
1111
return try .components(modifier(components))
1212

13-
case .url(let url):
13+
case let .url(url):
1414
let components: SmartUrlComponents = try .init(url: url)
1515
return try .components(modifier(components))
1616

17-
case .components(let components):
17+
case let .components(components):
1818
let components: SmartUrlComponents = try components.url.map(SmartUrlComponents.init).unwrap(orThrow: RequestEncodingError.brokenURL)
1919
return try .components(modifier(components))
2020
}

Source/Content/DecodableContent.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public struct DecodableContent<Response: Decodable>: Deserializable {
8080
return .success(result)
8181
} catch {
8282
switch keyPath.fallback {
83-
case .error(let error):
83+
case let .error(error):
8484
return .failure(error)
85-
case .value(let value):
85+
case let .value(value):
8686
return .success(value)
8787
case .none:
8888
return .failure(error)

Source/Error/RequestDecodingError.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension RequestDecodingError: RequestErrorDescription {
2828
/// Structured short name used for logs and diagnostics.
2929
public var subname: String {
3030
switch self {
31-
case .other(let encodingError):
31+
case let .other(encodingError):
3232
let description = (encodingError as NSError).description
3333
return ".other(\(description))"
3434

@@ -44,7 +44,7 @@ extension RequestDecodingError: RequestErrorDescription {
4444
case .emptyResponse:
4545
return "emptyResponse"
4646

47-
case .brokenKeyPath(let key):
47+
case let .brokenKeyPath(key):
4848
return "brokenKeyPath(\(key))"
4949
}
5050
}

Source/Error/RequestEncodingError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension RequestEncodingError: RequestErrorDescription {
2828
/// Used by the `RequestErrorDescription` protocol to generate meaningful output for each error case.
2929
public var subname: String {
3030
switch self {
31-
case .other(let encodingError):
31+
case let .other(encodingError):
3232
let description = (encodingError as NSError).description
3333
return ".other(\(description))"
3434

Source/Error/RequestError.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public indirect enum RequestError: Error {
2626
/// it is automatically wrapped in the appropriate `RequestError` case.
2727
public init(_ error: Swift.Error) {
2828
switch error {
29-
case RequestError.other(let newError):
29+
case let RequestError.other(newError):
3030
self = .init(newError)
3131
case let error as Self:
3232
self = error
@@ -66,7 +66,7 @@ extension RequestError: RequestErrorDescription {
6666
case .generic:
6767
return "generic"
6868

69-
case .other(let error):
69+
case let .other(error):
7070
let description: String =
7171
if let subname = (error as? RequestErrorDescription)?.subname {
7272
subname
@@ -75,16 +75,16 @@ extension RequestError: RequestErrorDescription {
7575
}
7676
return "other(\(description))"
7777

78-
case .connection(let error):
78+
case let .connection(error):
7979
return "connection(URLError \(error.code.rawValue))"
8080

81-
case .encoding(let error):
81+
case let .encoding(error):
8282
return "encoding(.\(error.subname))"
8383

84-
case .decoding(let error):
84+
case let .decoding(error):
8585
return "decoding(.\(error.subname))"
8686

87-
case .statusCode(let error):
87+
case let .statusCode(error):
8888
return "statusCode(.\(error.subname))"
8989
}
9090
}

Source/Extensions/Collection+SN.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal extension Optional where Wrapped: Collection {
4646
switch self {
4747
case .none:
4848
return nil
49-
case .some(let wrapped):
49+
case let .some(wrapped):
5050
return wrapped.isEmpty ? nil : wrapped
5151
}
5252
}

0 commit comments

Comments
 (0)