You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubfnfunc(){// This need to be called first always.letmut ret = foo1();ifcond(){// Overwrite with some complex expr.
ret = (foo2()*2).to_string().len()as_;}baz(ret)}
It suggest writing let <mut> ret = if cond() { .. foo2() .. } else { foo1() };, which cause 3 function calls (may have side-effects) being reordered, and foo1() not always being called.
Well, I'm not sure how to write make it more idiomatic in this case...