I just wanted to open source my gsync crate and now I'm rewriting anyhow and considering writing an RFC to add a fn to Formatter.https://twitter.com/codeability/status/1207763291717566464 …
-
-
-
Replying to @NikolaiVazquez
is_termination so you can write formatting logic that is conditional upon being printed by main which let's you write nice error reporting types.
1 reply 0 retweets 0 likes -
Replying to @yaahc_
That feels like an antipattern. I wish returning an error in main would just use the Display impl always
3 replies 0 retweets 1 like
Replying to @NikolaiVazquez @yaahc_
David Tolnay Retweeted David Tolnay
That seems to be almost everyone's instinct but it turns out using Display would be way worse (https://twitter.com/davidtolnay/status/1206980936639733761 …).
David Tolnay added,
David Tolnay @davidtolnay
Replying to @kixunil @spacekookie @yaahc_
I strongly disagree that it was a mistake, Display would be worse. In order for applications to have control over rendering cause chains, error types are required to *not* print their causes from the Display impl.
The right approach is exposing is_termination on Formatter.
11:44 AM - 20 Dec 2019
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.