Skip to content

Commit fe69edf

Browse files
authored
Fix Swift 6 concurrency: Add Sendable constraint to fetchStream generic type (#23)
This resolves the data race warning 'Sending decoded risks causing data races' by ensuring that the generic type T conforms to both Decodable and Sendable protocols.
1 parent 925a193 commit fe69edf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Ollama/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public final class Client: Sendable {
134134
}
135135
}
136136

137-
func fetchStream<T: Decodable>(
137+
func fetchStream<T: Decodable & Sendable>(
138138
_ method: Method,
139139
_ path: String,
140140
params: [String: Value]? = nil

0 commit comments

Comments
 (0)