Implement Hash for ParseError#14
Conversation
madsmtm
left a comment
There was a problem hiding this comment.
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
HashforParseError.I assume that
CloneandCopywasn't added because potentially in the future some data might be added toParseError?I also replacedParseError::_privatewith#[non_exhaustive], kinda the new Rusty way to do this. Let me know if you want me to split this into a separate PR.