Skip to content

Commit 7bd8dad

Browse files
Fix compiler warnings in example projects (apple#506)
### Motivation A recent example project was added that had a compiler warning which wasn't caught by CI. We can have our example code free of warnings and ensure they remain so by compiling them with `-warnings-as-errors` in CI. On further investigation, we cannot enable `-warnings-as-errors` in the examples Ci pipeline because we're reusing the shared build/cache directories which produces its own warnings for left over unused modules. ### Modifications - Fix compiler warnings in example. - ~Build with `-warnings-as-errors` in examples CI pipeline.~ ### Result Example projects compile without warnings. ### Test Plan ~CI updated.~
1 parent 62dfe94 commit 7bd8dad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Examples/event-streams-server-example/Sources/EventStreamsServer/GreetingStream.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class StreamStorage: @unchecked Sendable {
2525
private func finishedStream(id: String) {
2626
lock.lock()
2727
defer { lock.unlock() }
28-
guard let task = locked_streams[id] else { return }
28+
guard locked_streams[id] != nil else { return }
2929
locked_streams.removeValue(forKey: id)
3030
print("Finished stream \(id)")
3131
}

0 commit comments

Comments
 (0)