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

feat(error): allow ErrorKind to be compared #23

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

aidant
Copy link
Contributor

@aidant aidant commented Jan 18, 2025

The ErrorKind enum does not implement the PartialEq trait which makes for simple comparisons on the error_response.kind() function tedious. With this change the following becomes possible:

impl From<resend_rs::Error> for Error {
    fn from(value: resend_rs::Error) -> Self {
        match value {
            resend_rs::Error::Resend(error_response)
                if error_response.kind() == resend_rs::types::ErrorKind::InvalidToAddress =>
            {
                todo!()
            }
            _ => todo!(),
        }
    }
}

@AntoniosBarotsis AntoniosBarotsis merged commit da9e863 into resend:main Jan 18, 2025
1 check passed
@AntoniosBarotsis
Copy link
Collaborator

@aidant
Thanks for bringing this up! v0.11.2 just got published with this change. Let me know if you encounter any other issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants