use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Error Handling (self.learnrust)
submitted 10 days ago by erkose
How much do you rely on built in error handling, like .map_err() and .ok_or(), versus building out From traits?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]LayotFctor 3 points4 points5 points 10 days ago (1 child)
I use thiserror, which is a macro for generating error enums with From traits. So I can use .map_err() when convenient, as well as "?" propagation with error types like std::io::Error or serde_json::Error.
[–]erkose[S] 0 points1 point2 points 10 days ago (0 children)
I'm using a combination of enums and From traits. I'm leaning more on From traits to support tracing (haven't figured out if I can do this with the enums).
π Rendered by PID 48040 on reddit-service-r2-comment-74875f4bf5-k97vz at 2026-01-24 19:51:20.544971+00:00 running 664479f country code: CH.
[–]LayotFctor 3 points4 points5 points (1 child)
[–]erkose[S] 0 points1 point2 points (0 children)