-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
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.
Pull Request Test Coverage Report for Build 12069714020Details
💛 - Coveralls |
@@ -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}"))? |
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.
This is fine, though I think using anyhow
(and keeping .context
) is more ergonomic than this map_err
.
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.
True, in the apps we should use anyhow. I should have waited longer for your review. :)
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.
No big deal 😄
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.