Skip to content

Commit 3ff19ff

Browse files
committed
fix: Compiler warnings about Swift 6 compatibility and Sendable conformance.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
1 parent 6a4b5a5 commit 3ff19ff

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

Sources/NextcloudFileProviderKit/Interface/ChangeNotificationInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
import Foundation
55

6-
public protocol ChangeNotificationInterface {
6+
public protocol ChangeNotificationInterface: Sendable {
77
func notifyChange()
88
}

Sources/NextcloudFileProviderKit/Interface/FileProviderChangeNotificationInterface.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
22
// SPDX-License-Identifier: GPL-2.0-or-later
33

4-
import FileProvider
4+
@preconcurrency import FileProvider
55
import Foundation
66

7-
public class FileProviderChangeNotificationInterface: ChangeNotificationInterface {
7+
public final class FileProviderChangeNotificationInterface: ChangeNotificationInterface {
88
let domain: NSFileProviderDomain
99
let logger: FileProviderLogger
1010

Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public enum AuthenticationAttemptResultState: Int {
2323
/// Usually, the shared `NextcloudKit` instance is conforming to this and provided as an argument.
2424
/// NextcloudKit is not mockable as of writing, hence this protocol was defined to enable testing.
2525
///
26-
public protocol RemoteInterface {
26+
public protocol RemoteInterface: Sendable {
2727
func setDelegate(_ delegate: NextcloudKitDelegate)
2828

2929
func createFolder(

Sources/NextcloudFileProviderKitMocks/TestableRemoteInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import NextcloudCapabilitiesKit
77
@testable import NextcloudFileProviderKit
88
import NextcloudKit
99

10-
public struct TestableRemoteInterface: RemoteInterface {
10+
public struct TestableRemoteInterface: RemoteInterface, @unchecked Sendable {
1111
public init() {}
1212

1313
public func setDelegate(_: any NextcloudKitDelegate) {}

Tests/Interface/MockChangeNotificationInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import Foundation
55
import NextcloudFileProviderKit
66

7-
public class MockChangeNotificationInterface: ChangeNotificationInterface {
7+
public class MockChangeNotificationInterface: ChangeNotificationInterface, @unchecked Sendable {
88
public var changeHandler: (() -> Void)?
99
public init(changeHandler: (() -> Void)? = nil) {
1010
self.changeHandler = changeHandler

Tests/Interface/MockNotifyPushServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import NIOPosix
77
import NIOWebSocket
88

99
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
10-
public class MockNotifyPushServer {
10+
public class MockNotifyPushServer: @unchecked Sendable {
1111
/// The server's host.
1212
private let host: String
1313
/// The server's port.

Tests/Interface/MockRemoteInterface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ let mockCapabilities = ##"""
554554
}
555555
"""##
556556

557-
public class MockRemoteInterface: RemoteInterface {
557+
public class MockRemoteInterface: RemoteInterface, @unchecked Sendable {
558558
///
559559
/// `RemoteInterface` makes it necessary to bypass its API to fully register a mocked account object.
560560
///

0 commit comments

Comments
 (0)