-
Notifications
You must be signed in to change notification settings - Fork 56
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
Provide implementations of From<&str>
and From<String>
for Report
#60
Comments
These impls are only valid because they exist in the same crate that defines Once that initiative has completed we should be able to add |
Oh interesting, didn't knew that. But wouldn't it be easier to just |
That's already been ruled out. They absolutely could impl |
I am closing this issue as the points seem to be resolved as a string alone is not necessarily an error but may be any sort of thing, and as such making it an error would be errorprone |
The standard library has the implementations
From<'_ &str> for Box<dyn Error>
andFrom<String> for Box<dyn Error>
. This allows for example the following, convenient code:Basically I use it a lot to change
Option
s intoResult
s in application code. When using eyre as a drop-in replacement forResult<..., Box<dyn Error>>
I have to change all of theseok_or
calls and wrap the strings with an extra macro call toeyre!
. This is inconvenient. Therefore this is a request to provide these implementations.References:
The text was updated successfully, but these errors were encountered: