Closed XAMPPRocky closed 4 years ago
Duplicate of #99?
Seems so, closing
It is possible that this is unique, however. The duplicate is mostly about including the lifetime-parameterized error inside the new error, you mention that you want to transform it to an owned error.
Well I just want to able to carry the nom error, and if not that transform for it into any error type I could carry instead. Right now, I'm basically converting it into a String
so snafu never knows nom is even involved.
Hello, I'm using snafu in my library which also uses nom which has a generic error type of
nom::Err<E>
which is commonlynom::<(&[u8], nom::error::ErrorKind)>
. Currently, unless I'm missing something; it doesn't seem like you can convert from that error type to your own using thesource(from())
attribute. Since it asks for you to define a lifetime which I can't do from the attribute, so right now I have to attachmap_err
to every nom call to map it into a owned type first. It would be nice ifsnafu
could easily handle this kind of complex error type more easily.Example