I think your playground link might be broken because of all the amp bits.
Rust
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
You are right. I fixed it just now. That is an annoying "feature" of lemmy...
Converting ampersands to say amp instead is a bug that got fixed in version 0.19, world hasnt upgraded yet though
Amp is a Google thing, not a Lemmy thing. I can't see the original, so I can't tell if it's a Lemmy thing or some client that has issues.
They're talking about &
, the HTML code for an ampersand.
Ah, thanks. :)
Is there any way I can get this to work?
Probably not, but it has been suggested. I'm a little surprised that yield
is an expression here, because the RFC seems to only allow it as a statement.
The only way I can think of doing it is to use something like a channel (send the receive end to the coroutine) and read right after yielding. Nothing in the API suggests that they've taken that into account yet.
Maybe it's going to be addressed in a follow-up RFC? Like maybe there will be an optional resume_with_value()
or something?