mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-25 04:47:48 +00:00
Enable strict concurrency (#53)
Motivation: To catch potential data races at build time. Modifications: - Enable strict concurrency in Package.swift. - Add `Sendable` conformance to `StructuredFieldType`. - Swap [concurrency-unsafe](https://github.com/swiftlang/swift/issues/66213) `CommandLine.arguments` for `ProcessInfo.processInfo.arguments`. Result: Strict concurrency adoption.
This commit is contained in:
1 parent
8126775202
commit
0d92bf6b08
3 files changed
+9
-2
No files matched your search
@@ -45,3 +45,9 @@ let package = Package(
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
for target in package.targets {
|
||||
var settings = target.swiftSettings ?? []
|
||||
settings.append(.enableExperimentalFeature("StrictConcurrency=complete"))
|
||||
target.swiftSettings = settings
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public protocol StructuredFieldValue: Codable {
|
||||
}
|
||||
|
||||
/// The kinds of header fields used in HTTP Structured Headers.
|
||||
public enum StructuredFieldType {
|
||||
public enum StructuredFieldType: Sendable {
|
||||
/// An item field consists of a single item, optionally with parameters.
|
||||
case item
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ struct Flags {
|
||||
init() {
|
||||
// Default to item
|
||||
self.headerType = .item
|
||||
let arguments = ProcessInfo.processInfo.arguments
|
||||
|
||||
for argument in CommandLine.arguments.dropFirst() {
|
||||
for argument in arguments.dropFirst() {
|
||||
switch argument {
|
||||
case "--dictionary":
|
||||
self.headerType = .dictionary
|
||||
|
||||
Reference in new issue
Block a user