Get the latest tech news
Using unwrap() in Rust is Okay (2022)
I blog mostly about my own programming projects.
(Note: anyhow is great for application oriented code, but if one is building a library intended for others to use, I’d suggest writing out concrete error types and providing an appropriate std::fmt::Display impl. Additionally, documentation examples tend to be targeting the demonstration of some particular facet of an API, and expecting them to be perfectly idiomatic in every other aspect—especially if it distracts focus from the point of the example—seems unrealistic. Needing to write expect() and come up with a message, I agree, exercises more brain cells and probably does result in folks thinking more deeply about whether a panic can occur.
Or read this on Hacker News