Skip to content

Commit 907a124

Browse files
Fixed Swift 6 support on linux now that it's been released
1 parent 01fb4cc commit 907a124

File tree

9 files changed

+12
-32
lines changed

9 files changed

+12
-32
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
),
1919
],
2020
dependencies: [
21-
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.3.0")),
21+
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.3.1")),
2222
.package(url: "https://github.com/mochidev/Bytes.git", .upToNextMinor(from: "0.3.0")),
2323
],
2424
targets: [

Package@swift-6.0.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
),
1919
],
2020
dependencies: [
21-
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.3.0")),
21+
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.3.1")),
2222
.package(url: "https://github.com/mochidev/Bytes.git", .upToNextMinor(from: "0.3.0")),
2323
],
2424
targets: [
@@ -27,17 +27,11 @@ let package = Package(
2727
dependencies: [
2828
"AsyncSequenceReader",
2929
"Bytes"
30-
],
31-
swiftSettings: [
32-
.swiftLanguageVersion(.v6),
3330
]
3431
),
3532
.testTarget(
3633
name: "CodableDatastoreTests",
37-
dependencies: ["CodableDatastore"],
38-
swiftSettings: [
39-
.swiftLanguageVersion(.v6),
40-
]
34+
dependencies: ["CodableDatastore"]
4135
),
4236
]
4337
)

Sources/CodableDatastore/Indexes/UUID+Comparable.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import Foundation
1010

1111
/// Make UUIDs comparable on platforms that shipped without it, so that they can be used transparently as an index.
12+
#if !canImport(FoundationEssentials)
1213
#if swift(<5.9) || os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Linux) || os(Windows)
1314
#if compiler(>=6)
1415
extension UUID: @retroactive Comparable {
@@ -28,6 +29,7 @@ extension UUID: Comparable {
2829
}
2930
#endif
3031
#endif
32+
#endif
3133

3234
/// Make UUIDs comparable, so that they can be used transparently as an index.
3335
///

Sources/CodableDatastore/Persistence/Disk Persistence/ISO8601DateFormatter+Milliseconds.swift

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import Foundation
1010

1111
extension ISO8601DateFormatter {
12-
#if compiler(>=6)
13-
nonisolated(unsafe)
1412
static let withMilliseconds: ISO8601DateFormatter = {
1513
let formatter = ISO8601DateFormatter()
1614
formatter.timeZone = TimeZone(secondsFromGMT: 0)
@@ -23,20 +21,6 @@ extension ISO8601DateFormatter {
2321
]
2422
return formatter
2523
}()
26-
#else
27-
static let withMilliseconds: ISO8601DateFormatter = {
28-
let formatter = ISO8601DateFormatter()
29-
formatter.timeZone = TimeZone(secondsFromGMT: 0)
30-
formatter.formatOptions = [
31-
.withInternetDateTime,
32-
.withDashSeparatorInDate,
33-
.withColonSeparatorInTime,
34-
.withTimeZone,
35-
.withFractionalSeconds
36-
]
37-
return formatter
38-
}()
39-
#endif
4024
}
4125

4226
extension JSONDecoder.DateDecodingStrategy {
@@ -59,8 +43,8 @@ extension JSONEncoder.DateEncodingStrategy {
5943
}
6044
}
6145

62-
#if !canImport(Darwin)
63-
extension ISO8601DateFormatter: @unchecked Sendable {}
46+
#if compiler(>=6)
47+
extension ISO8601DateFormatter: @unchecked @retroactive Sendable {}
6448
extension JSONDecoder.DateDecodingStrategy: @unchecked Sendable {}
6549
extension JSONEncoder.DateEncodingStrategy: @unchecked Sendable {}
6650
#endif

Tests/CodableDatastoreTests/DiskPersistenceDatastoreIndexTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import XCTest
1414

1515
fileprivate struct SortError: Error, Equatable {}
1616

17-
final class DiskPersistenceDatastoreIndexTests: XCTestCase {
17+
final class DiskPersistenceDatastoreIndexTests: XCTestCase, @unchecked Sendable {
1818
var temporaryStoreURL: URL = FileManager.default.temporaryDirectory
1919

2020
override func setUp() async throws {

Tests/CodableDatastoreTests/DiskPersistenceDatastoreTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import XCTest
1313
@testable import CodableDatastore
1414

15-
final class DiskPersistenceDatastoreTests: XCTestCase {
15+
final class DiskPersistenceDatastoreTests: XCTestCase, @unchecked Sendable {
1616
var temporaryStoreURL: URL = FileManager.default.temporaryDirectory
1717

1818
override func setUp() async throws {

Tests/CodableDatastoreTests/DiskPersistenceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import XCTest
1313
@testable import CodableDatastore
1414

15-
final class DiskPersistenceTests: XCTestCase {
15+
final class DiskPersistenceTests: XCTestCase, @unchecked Sendable {
1616
var temporaryStoreURL: URL = FileManager.default.temporaryDirectory
1717

1818
override func setUp() async throws {

Tests/CodableDatastoreTests/DiskTransactionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import XCTest
1313
@testable import CodableDatastore
1414

15-
final class DiskTransactionTests: XCTestCase {
15+
final class DiskTransactionTests: XCTestCase, @unchecked Sendable {
1616
var temporaryStoreURL: URL = FileManager.default.temporaryDirectory
1717

1818
override func setUp() async throws {

Tests/CodableDatastoreTests/SnapshotTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import XCTest
1313
@testable import CodableDatastore
1414

15-
final class SnapshotTests: XCTestCase {
15+
final class SnapshotTests: XCTestCase, @unchecked Sendable {
1616
var temporaryStoreURL: URL = FileManager.default.temporaryDirectory
1717

1818
override func setUp() async throws {

0 commit comments

Comments
 (0)