-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Replace try_send/try_recv with is_closed #10138
Comments
Oh, actually removing |
Maybe rename |
|
We use it an a number of locations in Servo, fwiw. |
I use it for a receiver collecting every messages send by tasks via SharedChan (ie map reduce). Why not replace actual try_recv() by an implémentation of Iterator::next()? |
It seems like moving to is_closed would introduce a race. |
delegating to @alexcrichton to clean tags post nomination. |
Closing in favor of #10459. |
Fix typo in `unused_self` diagnostic message changelog: Msg: [`unused_self`]: The message now correctly uses *an* [rust-lang#10138](rust-lang/rust-clippy#10138) <!-- changelog_checked -->
These methods combine two operations: send/recv and check whether the channel is closed.
try_recv
in particular does not do what you would expect - recv or return immediately if no message is available.No expressiveness would be lost by making the
is_closed
check its own method, though it may be slightly less efficient.Nominating.
The text was updated successfully, but these errors were encountered: