Rust pattern: Iterating an over a Rc>

from blog baby steps, | ↗ original
This post examines a particular, seemingly simple problem: given ownership of a Rc>, can we write a function that returns an impl Iterator? It turns out that this is a bit harder than it might at first appear – and, as we’ll see, for good reason. I’ll dig into what’s going on, how you can fix it, and how we might extend the language in the future...