Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

impl<Inner> From<Inner> for Context<Inner> #75

Closed
est31 opened this issue Nov 23, 2017 · 1 comment
Closed

impl<Inner> From<Inner> for Context<Inner> #75

est31 opened this issue Nov 23, 2017 · 1 comment

Comments

@est31
Copy link

est31 commented Nov 23, 2017

I am personally trying out now a light variant of the custom Error + ErrorKind approach, where I have an ErrorKind but instead of a custom Error I just use type MyError = Context<MyErrorKind>;.

This works great for the usual from impl's but it doesn't help when I want to return try!(Err(ErrorKind::SomeKind)) directly.

Therefore I think it would be great to always have From<Inner> implemented for Context<Inner>. Right now I have to do try!(Err(Context::new(ErrorKind::SomeKind))) instead, or impl the from myself, but neither are nice things to do :).

@withoutboats
Copy link
Contributor

I think I just didn't think about doing this! I don't think there is any coherence issue. I'm for it, and I've tagged this issue help wanted :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants