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

all: Port from chainerror to thiserror #114

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

zeenix
Copy link
Collaborator

@zeenix zeenix commented Nov 28, 2024

The latter is quite ubiquitous in the Rust ecosystem so let's use that.

Warning: This is a breaking change so the semver versions are also being bumped.

@zeenix zeenix requested review from cgwalters and haraldh November 28, 2024 13:17
The latter is quite ubiquitous in the Rust ecosystem so let's use that.

Warning: This is a breaking change so the semver versions should be bumped.
@coveralls
Copy link

coveralls commented Nov 28, 2024

Pull Request Test Coverage Report for Build 12069714020

Details

  • 15 of 71 (21.13%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 57.257%

Changes Missing Coverage Covered Lines Changed/Added Lines %
varlink_generator/src/bin/varlink-rust-generator.rs 0 1 0.0%
varlink_parser/src/lib.rs 8 9 88.89%
varlink-certification/src/main.rs 0 2 0.0%
varlink_generator/src/lib.rs 4 6 66.67%
varlink-cli/src/proxy.rs 0 3 0.0%
varlink-cli/src/main.rs 0 47 0.0%
Files with Coverage Reduction New Missed Lines %
varlink-cli/src/main.rs 1 0.0%
Totals Coverage Status
Change from base Build 12051781918: 0.1%
Covered Lines: 2797
Relevant Lines: 4885

💛 - Coveralls

@zeenix zeenix merged commit 20a96b3 into varlink:master Dec 2, 2024
14 checks passed
@zeenix zeenix deleted the thiserror branch December 2, 2024 12:03
@@ -26,14 +25,12 @@ pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + 'static
fn varlink_format(filename: &str, line_len: Option<&str>, should_colorize: bool) -> Result<()> {
let mut buffer = String::new();
File::open(Path::new(filename))
.context(format!("Failed to open '{}'", filename))?
.map_err(|e| format!("Failed to open '{filename}': {e}"))?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, though I think using anyhow (and keeping .context) is more ergonomic than this map_err.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, in the apps we should use anyhow. I should have waited longer for your review. :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No big deal 😄

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.

3 participants