I have some code that looks like this
let mut x = ...;
while let Some(x_) = foo(x) {
x = x_;
bar(x);
}
baz(x);
I'd like to write it as
let mut x = ...;
while let Some(x) = foo(x) {
bar(x);
}
baz(x);
but afaik this will shadow the outer mutable x
instead of assigning to it. Note that I need access to the final value of x
after the loop ends.