Skip to content
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

Merged
merged 2 commits into from
Feb 18, 2023

Conversation

skyzh
Copy link
Contributor

@skyzh skyzh commented Feb 18, 2023

Thanks to @kornelski for a quick review for my PR to cargo_toml and we can remove the workaround now!

Copy link
Owner

@obi1kenobi obi1kenobi left a 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!

src/manifest.rs Outdated Show resolved Hide resolved
src/manifest.rs Outdated Show resolved Hide resolved
Signed-off-by: Alex Chi <iskyzh@gmail.com>
@skyzh skyzh force-pushed the skyzh/bump-cargo-toml branch from 0bbeba8 to 580142a Compare February 18, 2023 19:25
@skyzh
Copy link
Contributor Author

skyzh commented Feb 18, 2023

Comment resolved! Actually we can use anyhow's .context here, which produces something like (as in anyhow::Context 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.

@obi1kenobi
Copy link
Owner

obi1kenobi commented Feb 18, 2023 via email

Signed-off-by: Alex Chi <iskyzh@gmail.com>
@skyzh
Copy link
Contributor Author

skyzh commented Feb 18, 2023

done :)

@obi1kenobi obi1kenobi merged commit 1a90ed7 into obi1kenobi:main Feb 18, 2023
@obi1kenobi
Copy link
Owner

Awesome! Thank you so much!

@skyzh skyzh deleted the skyzh/bump-cargo-toml branch February 18, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants