Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Where Violation when using filter first #254

Open
LucasVanDongen opened this issue Feb 12, 2020 · 0 comments
Open

First Where Violation when using filter first #254

LucasVanDongen opened this issue Feb 12, 2020 · 0 comments

Comments

@LucasVanDongen
Copy link

So I have this slightly redacted piece of code:

self.webSocketHandler.isConnected.filter { $0 }.first().observeNext { _ in }

It's giving me the following warning (not sure if it's SwiftLint or vanilla Xcode though...):

First Where Violation: Prefer using .first(where:)over.filter { }.first in collections. (first_where)

However the first(where:) method doesn't seem to exist in that context.

It's not a big issue and perhaps I'm overlooking a better way to do it but it would be nice if it would actually have first(where:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant