TMDB icon indicating copy to clipboard operation
TMDB copied to clipboard

Catch will never get executed.

Open comiclandapp opened this issue 3 years ago • 0 comments

Awesome repo. Thank you, sir.

I have a question rather than an issue.

In Publisher+Utils.swift, I get a warning that the .catch will never get executed (Xcode Version 12.5 beta 3).

Any suggestions to fix that warning?

Thanks and regards.

extension Publisher {
...
    static func just(_ output: Output) -> AnyPublisher<Output, Failure> {
        return Just(output)
            .catch { _ in AnyPublisher<Output, Failure>.empty() }
            .eraseToAnyPublisher()
    }
...
}

comiclandapp avatar Apr 29 '21 22:04 comiclandapp