-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
bump cargo-toml to 0.15.2 and remove workarounds #374
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening a PR for the fix!
Signed-off-by: Alex Chi <iskyzh@gmail.com>
0bbeba8
to
580142a
Compare
Comment resolved! Actually we can use anyhow's
let parsed = cargo_toml::Manifest::from_path(&path)
.with_context(|e| format!("Failed when reading {}", path.display())?; Do you feel this is a better way to throw an error? If so I can refactor map_err to context for manifest errors in this PR. |
Yes, definitely! Thanks!
…On Sat, Feb 18, 2023, 2:28 PM Alex Chi ***@***.***> wrote:
Comment resolved! Actually we can use anyhow's .context here, which
produces something like (as in anyhow::Context
<https://docs.rs/anyhow/latest/anyhow/trait.Context.html> example):
Error: Failed to read instrs from ./path/to/instrs.json
Caused by:
No such file or directory (os error 2)
let parsed = cargo_toml::Manifest::from_path(&path)
.with_context(|e| format!("Failed when reading {}", path.display())?;
Do you feel this is a better way to throw an error? If so I can refactor
map_err to context for manifest errors in this PR.
—
Reply to this email directly, view it on GitHub
<#374 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR5MSSV5HWTH6MILONGV53WYEPGVANCNFSM6AAAAAAVAA3X7Y>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Signed-off-by: Alex Chi <iskyzh@gmail.com>
done :) |
Awesome! Thank you so much! |
Thanks to @kornelski for a quick review for my PR to cargo_toml and we can remove the workaround now!