This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm coming over from C background. The lesson for today was error handling. I set myself a task of defining three custom errors and handling them together with "naturally arising errors"
https://github.com/fireice-uk/rus_errors/blob/main/src/main.rs
I have defined three error types
ErrorNumberIsOne
ErrorNumberIsTwo
ErrorNumberIsOther
- any way to cut the boilerplate code there? I tried to make them somehow "inherit" off a shared base but couldn't get it to workAny way to get the error handling on line 90 to work?
Any way to reduce boilerplate on 102 - 112?
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rust/commen...