-
Notifications
You must be signed in to change notification settings - Fork 138
Derive support for From implementations #275
Comments
I'm in support of this, but you should see #10. |
I would like this, too. I accept the points made in the old discussion regarding context, but often I am implementing a simple parser with only a single I/O operation in the whole file (reading the next line), and I want to capture the It would be that much smoother of an experience if I could just add |
@withoutboats Any new thoughts on this? Adding the |
I'm no longer actively involved in maintaining this library, not the correct person to ping. :) |
@withoutboats Ah my bad; I wasn't aware. |
Oftentimes, a custom error is an enum with variants, some of which are just wrappers around some foreign errors/causes.
The derive machinery allows for marking the field as
#[cause]
, like this:https://boats.gitlab.io/failure/derive-fail.html#overriding-cause
Would it make sense to add possibility to also derive
From
for such a newtype-style variant, eg by adding#[from]
attribute to it?The text was updated successfully, but these errors were encountered: