DEV Community

Discussion on: Rust looks awesome

Collapse
 
louy2 profile image
Yufan Lou

I think turning off strictness project-wide is too big a hammer. unwrap() is always used in Rust to defer error handling during prototyping, and the way Option and Result preserves the inner type information helps with silly mistakes. OTOH, if the strict compiler doesn't come with good type inference, I know how frustrating writing all the types manually can be. Rust's type inference is on par with OCaml, so you rarely need to declare types on variables. Where Rust struggles is if you use callback functions a lot: the closure types are restricted by the lifetime rules and can be unwieldy.