Skip to content

Commit 3db3350

Browse files
authored
tech(swift): Compile in Swift 6 (#31)
1 parent 07f5036 commit 3db3350

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: macos-latest
13+
runs-on: macos-26
1414

1515
steps:
1616
- name: Checkout repo

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:6.2
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

Sources/SimpleHTTP/MultipartForm/MultipartFormData.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import MobileCoreServices
77
import CoreServices
88
#endif
99

10-
struct Header: Hashable {
10+
struct Header: Hashable, Sendable {
1111
let name: HTTPHeader
1212
let value: String
1313
}
@@ -16,9 +16,9 @@ enum EncodingCharacters {
1616
static let crlf = "\r\n"
1717
}
1818

19-
enum Boundary {
19+
enum Boundary: Sendable {
2020

21-
enum `Type` {
21+
enum `Type`: Sendable {
2222
case initial
2323
case encapsulated
2424
case final
@@ -49,19 +49,19 @@ enum Boundary {
4949
struct BodyPart {
5050
let headers: [Header]
5151
let length: Int
52-
let stream: () throws -> InputStream
52+
let stream: @Sendable () throws -> InputStream
5353

5454
var hasInitialBoundary = false
5555
var hasFinalBoundary = false
5656

57-
private init(headers: [Header], stream: @escaping () throws -> InputStream, length: Int) {
57+
private init(headers: [Header], stream: @Sendable @escaping () throws -> InputStream, length: Int) {
5858
self.headers = headers
5959
self.length = length
6060
self.stream = stream
6161
}
6262

6363
init(headers: [Header], url: URL, length: Int) {
64-
let stream: () throws -> InputStream = {
64+
let stream: @Sendable () throws -> InputStream = {
6565
guard let stream = InputStream(url: url) else {
6666
throw MultipartFormData.Error.inputStreamCreationFailed(url)
6767
}

Sources/SimpleHTTP/Request/Path.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Foundation
2121
///
2222
/// let user: Path = .myPaths.user
2323
/// ```
24-
public struct Path: Equatable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation {
24+
public struct Path: Equatable, Sendable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation {
2525
/// relative path
2626
public let value: String
2727

Sources/SimpleHTTP/Request/Request.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public enum Method: String {
3+
public enum Method: String, Sendable {
44
case get
55
case post
66
case put

Sources/SimpleHTTP/Response/DataResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct URLDataResponse {
3+
public struct URLDataResponse: Sendable {
44
public let data: Data
55
public let response: HTTPURLResponse
66

Sources/SimpleHTTPFoundation/HTTP/HTTPContentType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

33
/// A struct representing a http header content type value
4-
public struct HTTPContentType: Hashable, ExpressibleByStringLiteral {
4+
public struct HTTPContentType: Hashable, Sendable, ExpressibleByStringLiteral {
55
public let value: String
66

77
public init(value: String) {

Sources/SimpleHTTPFoundation/HTTP/HTTPHeader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
public typealias HTTPHeaderFields = [HTTPHeader: String]
55

66
/// A struct representing a http request header key
7-
public struct HTTPHeader: Hashable, ExpressibleByStringLiteral {
7+
public struct HTTPHeader: Hashable, Sendable, ExpressibleByStringLiteral {
88
public let key: String
99

1010
public init(stringLiteral value: StringLiteralType) {
@@ -17,7 +17,7 @@ extension HTTPHeader {
1717
public static let authentication: Self = "Authentication"
1818
public static let authorization: Self = "Authorization"
1919
public static let contentType: Self = "Content-Type"
20-
public static var contentDisposition: Self = "Content-Disposition"
20+
public static let contentDisposition: Self = "Content-Disposition"
2121
}
2222

2323
// swiftlint:disable line_length

0 commit comments

Comments
 (0)