-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve #[from] documentation example. #135
Comments
Thank you, I pretty much looked at the repo just hoping to find something like this. |
Took me a while to figure it out too. Should be included on README |
Even though it works, should this be encouraged by the documentation? I don't think that this is the idiomatic way to println!("Error: {error}");
println!("Caused by: {}", error.source().unwrap()); I guess this is how most people would expect this to behave, and they would get:
Maybe an example using |
Any answer from 2024? |
Hey folks,
There is an issue that took me a while to understand, and it's that in the lib doc is not very clear how to display the error that is being derived with
#[from]
macro.The actual example is e.g.
Despite there is also an example of how to use from attribute over a struct field e.g.
None of these examples tells you can do it e.g.
Would be great to have it in the doc.
Thanks!
The text was updated successfully, but these errors were encountered: