enum-utils icon indicating copy to clipboard operation
enum-utils copied to clipboard

Allow custom error type to be supplied

Open changhe3 opened this issue 5 years ago • 2 comments

I want to use this in conjunction with structopt, whose derive macro expands to this:

.validator(|s| {
                        ::std::str::FromStr::from_str(s.as_str())
                            .map(|_: Eval| ())
                            .map_err(|e| e.to_string())
                    })

Obviously this won't work as the default error type () doesn't implement Display.

changhe3 avatar Oct 04 '20 10:10 changhe3

I'd glad to see this too.

What I did is creating a wrapper type but I would prefer a native solution.

ChayimFriedman2 avatar Mar 07 '21 20:03 ChayimFriedman2

I'd love to see this too. Or if not this, then at least some sensible Error type that does implement std::error::Error.

harmic avatar Oct 18 '22 05:10 harmic