Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dedicated error types for Add and Not derives (#221) #233

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

tyranron
Copy link
Collaborator

Part of #221

Synopsis

See #221 (comment)

Solution

Adds ops::UnitError, ops::WrongVariantError and ops::BinaryError to derive_more crate and uses them in Add-like and Not-like derives.

Additionally:

  • Renames derive_more::errors module as derive_more::convert to follow std/core naming conventions.
  • Adds #[doc(hidden)] attribute on to new() methods of created error types. This way we mimic them as not public, thus won't introduce breaking changes in future once we need to modify their private fields.

Checklist

  • Documentation is updated (if required)
  • Tests are added/updated (if required)
  • CHANGELOG entry is added (if required)

@tyranron tyranron self-assigned this Jan 25, 2023
@tyranron tyranron requested a review from JelteF January 25, 2023 19:28
@tyranron tyranron added this to the 1.0.0 milestone Jan 25, 2023
@tyranron tyranron linked an issue Jan 25, 2023 that may be closed by this pull request
Copy link
Owner

@JelteF JelteF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! looks good.

@tyranron tyranron merged commit e3daf2c into master Jan 26, 2023
@tyranron tyranron deleted the error-types-for-add-not branch January 26, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use dedicated error type for errors returned by Add, Not and FromStr
2 participants