logoalt Hacker News

tptacekyesterday at 11:00 PM2 repliesview on HN

I also prefer Rust's enums and match statements for error handling, but think that their general-case "ergonomic" error handling patterns --- the "?" thing in particular --- actually make things worse. I was glad when Go killed the trial balloon for a similar error handling shorthand. The good Rust error handling is actually wordier than Go's.


Replies

jadsfwasdfsdtoday at 3:46 AM

Agreed. If only let-else let you match the error cases and it could have been useful for the Result type.

nu11ptrtoday at 12:31 AM

Nah, you just need to use `map_err` or apply a '.context' which I think anyhow can do (and my crate, `uni_error` certainly can otherwise).

show 1 reply