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 type for errors returned by Add, Not and FromStr #221

Closed
JelteF opened this issue Nov 14, 2022 · 0 comments · Fixed by #233 or #235
Closed

Use dedicated error type for errors returned by Add, Not and FromStr #221

JelteF opened this issue Nov 14, 2022 · 0 comments · Fixed by #233 or #235
Assignees
Milestone

Comments

@JelteF
Copy link
Owner

JelteF commented Nov 14, 2022

For consistency with #220 we should have custom error types for Add, Not and FromStr too

@JelteF JelteF added this to the 1.0.0 milestone Nov 14, 2022
@JelteF JelteF changed the title Use dedicated error type for errors returned by Add and Not enum implementations Use dedicated error type for errors returned by Add, Not and FromStr Nov 20, 2022
@tyranron tyranron linked a pull request Jan 25, 2023 that will close this issue
3 tasks
tyranron added a commit that referenced this issue Jan 26, 2023
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.
@tyranron tyranron reopened this Jan 26, 2023
@tyranron tyranron self-assigned this Jan 26, 2023
JelteF pushed a commit that referenced this issue Jan 26, 2023
Part of #221
Resolves #221

## Synopsis

#221 (comment)

## Solution

Adds `FromStrError` type and uses it in `#[derive(FromStr)]` expansion
for enums instead of generating an error type in-place.
liveseed added a commit to liveseed/derive_more that referenced this issue Aug 20, 2024
Part of #221
Resolves #221

## Synopsis

JelteF/derive_more#221 (comment)

## Solution

Adds `FromStrError` type and uses it in `#[derive(FromStr)]` expansion
for enums instead of generating an error type in-place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants