Uh oh!
There was an error while loading. Please reload this page.
Print out errname in impl Debug for Error - #287
Conversation
This comment has been minimized.
This comment has been minimized.
| } | ||
| impl fmt::Debug for Error { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
There was a problem hiding this comment.
I like the idea that we could have names instead of values for the Debug::fmt of Error. However, I think it's better that we don't need to call errname if we already have the corresponding const, e.g. Error::EINVAL, because having the const actually means we have names for the error numbers at Rust side.
Thoughts?
There was a problem hiding this comment.
We don't currently have constants for all errors defined in Rust. Plus, defining them in Rust essentially requires us to have a giant match, or define a lookup table like errname.c did. It might be better just to reuse errname, C side needs it anyway.
Uh oh!
There was an error while loading. Please reload this page.
I think there are a few further improvements that can be made to
|
This comment has been minimized.
This comment has been minimized.
TheSven73
commented
May 25, 2021
I like this. Moving to a more constrained type would eliminate at least one human "proof" elsewhere. That's probably a Good Thing(tm). |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Gary Guo <gary@garyguo.net>
ksquirrel
commented
May 26, 2021
Review of
|
ojeda
commented
May 26, 2021
LGTM. |
ojeda
commented
May 26, 2021
We could put some of #287 (comment) as an issue, perhaps a "good first issue". |
Depends on #273Merged