enum-utils
enum-utils copied to clipboard
Allow custom error type to be supplied
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.
I'd glad to see this too.
What I did is creating a wrapper type but I would prefer a native solution.
I'd love to see this too. Or if not this, then at least some sensible Error type that does implement std::error::Error.