Re:Rust vs. Go in 2023
by bryanlarsen on Sunday August 13, 2023 @10:07AM
(#37110168)
The thing about clone and to a lesser extent unwrap is that 90% of the time, just leaving in the clone is fine. It might be suboptimal, but if it's not in the main loop, who cares?
With unwrap, replacing the unwrap with an expect signals you've accepted that an unwrap is ok in that piece of code. I'd like a similar convention for clone.
This part of the comment deserves to be highlighted and mentioned more. I think this exactly the way to "hack something together quickly" in rust.
After that, incorporating correctness seems to be as simple as grepping with each unwrap and "dealing with it".
With the above approach, Rust is a great prototyping language as well.