-
I find that I frequently want to
When receiving from a let mut buf = [0; 64];
select! {
Ok(n) = socket.recv(&mut buf) => { /* Handle successful rx */ },
Err(e) = socket.recv(&mut buf) => { /* Handle rx error */ },
_ = another_future => { /* Handle that */ }
} but I obviously get an error about the multiple borrow of similarly, when receiving from an select! {
Some(msg) = receiver.recv() => { /* Handle message */ },
None = receiver.recv() => { /* Handle channel closed */ },
_ => another_future => { /* Handle it */ }
} And here I get the (expected) error that Right now I handle this by doing the matching outside of the Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
Darksonn
Jun 13, 2024
Replies: 1 comment
-
Select does not support that, you'll have to match separately from the select. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
coljnr9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Select does not support that, you'll have to match separately from the select.