This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/brisbanedev on 2023-11-04 06:20:05.


Which option is generally preferable for flexible error handling?

fn main() -> Result<(), Box>

or

fn main() -> anyhow::Result<()>

For quite a few programs that I have written, either works. Would one be more idiomatic than the other in such cases? I know the anyhow crate offers a lot more than Result, but here I am comparing just the two Results.