Thanks for this! I’ll see if I can work something like this in.
Thanks for this! I’ll see if I can work something like this in.
I definitely use that syntax whenever I can. One of the situations where I get stuck with the nested syntax that I shared is when the result of the function call in the for loop affects the inputs for that function call for the next item in the loop. Another is when I am using a heuristic to sort the iterator that I’m looping over such that most of the time I can break from the loop early, which is helpful if the function in the loop is heavy.
How does that change anything? Sorry if it wasn’t clear, this was assuming a function call in the for loop that returns either a Result or enum.
I know it’s not nearly as nested as this, but nesting in Rust annoys the hell out of me.
impl {
fn {
for {
match {
case => {
}
}
}
}
}
is something I’ve run into a few times
You wouldn’t download a car