Closed mathstuf closed 9 years ago
Agreed. Have you implemented this? I would be happy to merge a pull request. Otherwise I can look at it soon.
I have a really crappy implementation. Mainly due to my inexperience with Rust so far. String::from_str
and String::as_str
being unstable doesn't help. I basically make a WrapConfigError
with a string in it which stores the description string computed in From
rather than in description itself.
Here is my instance for it. Not really clean, but I'm also using 1.1, so I can't use unstable features.
OK, I've cleaned it up considerably. Still needs an intermediate type to own the description though, AFAICT.
@mathstuf Sorry for the delay. I kind of let the project die a bit, but I want to get back to it. It looks good, can you do a pull request? Though it's kind of a hacky solution, in the short-term I'd say it's enough, we can think about a cleaner interface later (I need to get back on track with Rust).
This would allow it to be used with
try!
in mixed contexts much easier.