Skip to content

Commit

Permalink
[picta/feat] Add Sendable and StrictConcurrency feature (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-nd authored Jan 2, 2024
1 parent 03b0b50 commit 09ddad1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.7
// swift-tools-version: 5.9

import PackageDescription

Expand All @@ -18,11 +18,13 @@ let package = Package(
targets: [
.target(
name: "Spyder",
dependencies: []
dependencies: [],
swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]
),
.testTarget(
name: "SpyderTests",
dependencies: ["Spyder"]
dependencies: ["Spyder"],
swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]
)
]
)
4 changes: 2 additions & 2 deletions Sources/Spyder/API+Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public enum HTTPMethod: String {
case delete, get, post, put
}

public struct HTTPResponse: Equatable {
public struct HTTPResponse: Sendable, Equatable {
public let statusCode: Int
public let headers: [Header]
public let data: Data
Expand All @@ -16,7 +16,7 @@ public struct HTTPResponse: Equatable {
}
}

public struct Header: Equatable, Hashable {
public struct Header: Sendable, Equatable, Hashable {
public let name: String
public let value: String

Expand Down
10 changes: 5 additions & 5 deletions Sources/Spyder/Builders/PropertyWrappers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@propertyWrapper
public struct RequestHeader {
public struct RequestHeader: Sendable {
let name: String
public var wrappedValue = ""

Expand All @@ -9,7 +9,7 @@ public struct RequestHeader {
}

@propertyWrapper
public struct PathArgument {
public struct PathArgument: Sendable {
let name: String
public var wrappedValue = ""

Expand All @@ -19,7 +19,7 @@ public struct PathArgument {
}

@propertyWrapper
public struct QueryArgument {
public struct QueryArgument: Sendable {
let name: String
public var wrappedValue = ""

Expand All @@ -29,7 +29,7 @@ public struct QueryArgument {
}

@propertyWrapper
public struct OptionalQueryArgument {
public struct OptionalQueryArgument: Sendable {
let name: String
public var wrappedValue: String? = .none

Expand All @@ -39,7 +39,7 @@ public struct OptionalQueryArgument {
}

@propertyWrapper
public struct Body {
public struct Body: Sendable {
public var wrappedValue: any Encodable

public init(wrappedValue: any Encodable) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Spyder/Builders/URLRequestBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
import FoundationNetworking
#endif

public protocol URLRequestBuilder {
public protocol URLRequestBuilder: Sendable {
static var method: HTTPMethod { get }
static var path: String { get }
}
Expand Down

0 comments on commit 09ddad1

Please sign in to comment.