Skip to content

Commit d288bfb

Browse files
authored
feat: Small Swift 6 concurrency cleanups to reduce warnings: Sendable hygiene (Filter, handler typealiases) (#39)
1 parent 42bd408 commit d288bfb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/Casbin/Adapter/Adapter.swift

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

1515
import NIO
1616

17-
public struct Filter {
17+
public struct Filter: Sendable {
1818
public init(p: [String], g: [String]) {
1919
self.p = p
2020
self.g = g

Sources/Casbin/Adapter/FileAdapter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
import NIO
1616

17-
public typealias LoadPolicyFileHandler = (String,Model) -> Void
18-
public typealias LoadFilteredPolicyFileHandler = (String,Model,Filter) -> Bool
17+
public typealias LoadPolicyFileHandler = @Sendable (String,Model) -> Void
18+
public typealias LoadFilteredPolicyFileHandler = @Sendable (String,Model,Filter) -> Bool
1919

2020
public final class FileAdapter {
2121
var filePath:String

0 commit comments

Comments
 (0)