4 ms·
I'm unfamiliar with the use of in as a keyword in the following snippet from the OP. I can't find anything on Google about it, either. Can anyone tell me more a
by heavyset_go 5y ago
I'm unfamiliar with the use of in as a keyword in the following snippet from the OP. I can't find anything on Google about it, either. Can anyone tell me more about it?
while let Some(line_in) in parse_line(&reader).await? {
broadcast_line(line_in)?;
}
- devit 5y agoIt's a mistake, it's supposed to be a "=".
- heavyset_go 5y agoThanks, I thought something new got snuck in after taking my thumb off the pulse of Rust development a while back.
- tialaramex 5y agoI don't think you're allowed to do this, but it's in a hypothetical, so the code doesn't actually work anyway. If you were allowed to use in this way, it feels reasonable right? parse_line eventually gave us an Iterator of line_in values, we iterate it until we get a None instead of a Some with a line_in value, and that exits the loop.
- heavyset_go 5y ago> If you were allowed to use in this way, it feels reasonable right? Yeah, that's why I was confused. I can imagine seeing something like this implemented with macros.