Conversation
eyre! macro to report!, and remove format_err!eyre! macro to report!, and remove the format_err! macro
|
I actually like the usage |
|
Please make a separate PR to remove the |
eyre! macro to report!, and remove the format_err! macroeyre! macro to report!
|
Because this macro expands to the |
|
FWIW, It follows the pattern of |
What I like about But if If a type-erased error type such as |
|
While I like Maybe 1.0 is a good time to let go of fun whimsy of the early days in favor of an obvious, self explanatory API. One counterpoint may be that most users never see For the sake of an obvious api, In the end, |
It's actually used quite a lot. The For reference, |
d7b70bd to
39d6617
Compare
|
I don't have a strong feeling either way on the rename. I like the idea of a |
Yeah, in my opinion - having 2 macros that do the same thing adds unnecessary choices to the user. It's easy to imagine multiple contributors to a codebase each with their own preference, causing an extra inconsistency |
e35d133 to
9449122
Compare
Considering eyre plans to release 1.0 some time soon (#269), it's a good time to clean up the API - to make the API leaner, help prevent choice overload, and make the macro names make more sense..
Having 2 macros that do the same thing leads to unnecessary churn in which name to use. That's why we should remove the
format_err!macro.On the other hand,
eyre!macro is not a good name - a better name isreport!, because aReportis created.Renaming
ok_or_eyretook_or_report(#272) will mean we are consistent with the naming ofok_or_reportmethod, and have more of a parallel between static error creation in theNonecase of an option, and dynamic error creation: