-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implement Hash
for ParseError
#14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure #[non_exhaustive]
really works on empty structs? See this playground
The docs render differently and show an empty struct rather than a private struct. So I would prefer not to do this. |
It does work, just not on a intra-crate level, but on a inter-crate level.
|
1af7fe6
to
dc2400f
Compare
Never seen this before: Line 12 in 9a8f7d0
What is this supposed to do and how exactly should this be fixed? |
@daxpedda the point was to not allow building of the struct while remaining it public, probably it does achieve that, but I don't really see a value in changing the |
I already reverted that because of @notgull's feedback. What it would have done is to use the recommended way Rust achieves exactly this, instead of having to add a field that does nothing, which is basically a workaround. Most people consider adhering to common code practices a code quality improvement. |
dc2400f
to
6399622
Compare
This implements
Hash
forParseError
.I assume that
Clone
andCopy
wasn't added because potentially in the future some data might be added toParseError
?I also replacedParseError::_private
with#[non_exhaustive]
, kinda the new Rusty way to do this. Let me know if you want me to split this into a separate PR.