2 ms·
Didn't downvote you because I presume you are arguing in good faith, but I have very different opinion about the ? operator, it is one of the best syntactic thi
by GolDDranks 5y ago
Didn't downvote you because I presume you are arguing in good faith, but I have very different opinion about the ? operator, it is one of the best syntactic things in Rust. In my experience, many Rustaceans agree. It's a minimal nuisance, while still being explicit in a good way.
Also, being able to call unsafe code inside unsafe functions is now considered a design mistake, and there is ongoing work to revert the default – requiring unsafe blocks even in unsafe functions: https://rust-lang.github.io/rfcs/2585-unsafe-block-in-unsafe-fn.html https://rust-lang.github.io/rfcs/2585-unsafe-block-in-unsafe...
- drran 5y agoBut `foo()?"A context message for a human".bar();` is even better. Currently, we must use anyhow's `foo().context("Message")?.bar()` [1] for that. [1]: https://docs.rs/anyhow/1.0.42/anyhow/trait.Context.html https://docs.rs/anyhow/1.0.42/anyhow/trait.Context.html