2 ms·
Looking at the code briefly, the first example could be written as let msg = timeout(Duration::from_secs(2), receiver.next()).await.ok()??; // not shown
by nothinkjustai 6mo ago
Looking at the code briefly, the first example could be written as
let msg = timeout(Duration::from_secs(2), receiver.next()).await.ok()??;
// not shown in article, but next line of code
let Message::Text(frame) = msg_result.ok()? else {
return None;
};
Looks like the fixed the second issue with anyhow::Result<()>
- hnlmorg 6mo agoThanks for sharing. I’ve learned something.