Project Improvement
Currently oxide_auth_rocket::OAuthFailure is a struct with a private inner field Kind which one can retrieve variants from via the oauth() and web() methods. If you want to roll your own error type (since OAuthFailure is not stable) you have to do some cumbersome matching that feels a bit un-rusty:
if let Some(web_failure) = failure.web() {
//...
} else if let Some(oauth_failure) = failure.oauth() {
//...
}
Turning the failure type into a non-exhaustive enum would allow users to match on the enum instead of having to call functions while still allowing the project to add new failure modes.
Other context
It just feels like a more ergonomic interface to use.
Tracking pull request
Project Improvement
Currently
oxide_auth_rocket::OAuthFailureis a struct with a private inner fieldKindwhich one can retrieve variants from via theoauth()andweb()methods. If you want to roll your own error type (sinceOAuthFailureis not stable) you have to do some cumbersome matching that feels a bit un-rusty:Turning the failure type into a non-exhaustive enum would allow users to match on the enum instead of having to call functions while still allowing the project to add new failure modes.
Other context
It just feels like a more ergonomic interface to use.
Tracking pull request