Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Conversation

@jlnquere
Copy link
Contributor

Each time we write this kind of code:

subscription.handle(Event.created) { _, _ in
    //
}

The compiler is not happy and give us a warning: Result of call to 'handle' is unused. To fix this, we have to write something like:

_ = subscription.handle(Event.created) { _, _ in
    //
}

But, often it's OK to ignore the result of theses handle methods. That's the purpose of the @discardableResult attribute. So, with this PR, we don't have to do the _ = trick anymore :)

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That's effectively way cleaner :)

@flovilmart flovilmart merged commit b0f8aab into parse-community:master May 24, 2017
@jlnquere jlnquere deleted the feature/discardableResults branch May 24, 2017 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants