r/rust • u/rustacean1337 • Nov 17 '22
What are Rust’s biggest weaknesses?
What would you say are Rust’s biggest weaknesses right now? And are they things that can be fixed in future versions do you think or is it something that could only be fixed by introducing a breaking change? Let’s say if you could create a Rust 2.0 and therefore not worry about backwards compatibility what would you do different.
220
Upvotes
View all comments
-1
u/VegetableBicycle686 Nov 17 '22
The lack of operations between different sizes of integer is needlessly awkward. It should be possible to add a
usizeto au8(resulting inusize) and even au32to achar(resulting inu32) without casts. This is something which reasonably could be fixed by writing some moreAdd/Sub/etc. implementations, perhaps in an edition.Also the decision to make the
Indexoperation (square brackets) generally panic if out of bounds makes it essentially useless for any application where panics are unacceptable.a[i]should returnNoneif out-of-bounds, instead of requiring a separate method,get().