3 ms·
The thing is, types like Rc should be avoided if possible in idiomatic Rust, it should not be: "Oh my code doesn't compile, that means I need to use Rc", this i
by AsyncAwait 10y ago
The thing is, types like Rc should be avoided if possible in idiomatic Rust, it should not be: "Oh my code doesn't compile, that means I need to use Rc", this is because most of the time it is you who made a mistake rather than the compiler.
- akiselev 10y agoYeah, sure, when you already know idiomatic Rust. The point is that many developers never even get close to understanding the borrow checker, let alone writing honest-to-goodness idiomatic Rust. This can be improved by showing them the unidiomatic stuff that they can use to suspend or shift guarantees. Besides, unwrap() is also terrible in this regard but it's the single most used feature in tutorial code. You need to teach someone Rust before they can learn idiomatic Rust.