4 ms·
Using `fn main() -> Result<(), Box<dyn Error>>` isn't necessarily unstylistic, the ability is there for a reason, but it is not great for CLI tools: it prints t
by estebank 4y ago
Using `fn main() -> Result<(), Box<dyn Error>>` isn't necessarily unstylistic, the ability is there for a reason, but it is not great for CLI tools: it prints the `Debug` output of the error, which in many occasions is great for a developer to figure out what went wrong, but from subpar to terrible for end-users. The main benefit of having main return a `Result` is being able to write `?` and be done with it. A tool meant to be used by others like ripgrep? You better use a more explicit mechanism to ensure good output for wording, context and formatting.