Async v5: Printing the payload #512
Unanswered
iot-resister
asked this question in
Q&A
Replies: 1 comment
-
Looks good, but I'd usually do it like this to make the branches more explicit: loop {
let packet = match eventloop.poll().await {
Ok(Event::Incoming(b)) => *b,
Err(_) => break,
_ => continue,
};
if let Packet::Publish(p, None) = packet {
println!("Received: {:?}", p.payload);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is this how the simplest/idiomatic way to get the payload?
Beta Was this translation helpful? Give feedback.
All reactions