-
-
Notifications
You must be signed in to change notification settings - Fork 136
Remove thiserror from dependencies
#436
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
Conversation
Before this change, the `fancy` feature required the `derive` feature to compile. Despite this, `derive` was not listed as a required feature to use `fancy`. This meant that building with: `cargo build --no-default-features --features fancy` would result in a compilation error! Now `fancy` can be used without `derive` enabled, and another use of `thiserror` has been removed!
|
Not sure what the doc consistency check is about, @zkat ! It seems to generate this diff, deleting a section of the README if I run the command in the makefile, but I don't know if that's correct... EDIT: It looks like this check was already failing on |
zkat
left a comment
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.
So exciting! Thanks so much for taking the time!
src/eyreish/into_diagnostic.rs
Outdated
| write!(f, "{msg}") | ||
| } | ||
| } | ||
| impl Error for DiagnosticError {} |
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.
error(transparent) forwards the source method
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.
Ach! Good catch! I think my tests must have missed that by not using an error with a source... I'll fix that up now!
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.
Should be fixed now!
| /// [`chain()`](Report::chain). | ||
| pub fn root_cause(&self) -> &(dyn StdError + 'static) { | ||
| self.chain().last().unwrap() | ||
| self.chain().next_back().unwrap() |
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.
For why?
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 was one of the clippy lints! Because that iterator is double-ended, you can just pop from the back to get the last element more efficiently!
Apparently calling .last() is wasteful in this case because it iterates through the whole iterator before it can return the last value (https://rust-lang.github.io/rust-clippy/stable/index.html#/next_back)
I hadn't thought about that before!
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.
Oh! Huh! Good call
|
I suppose changing MSRV is probably not a SemVer patch change... I'll roll back my fancy-pants |
|
Trying to fix that README thing now too, since the CI bullied me and I'm looking for revenge (green checkmark...) |
|
CI successfully slain ⚔️ 😌 Should be ready for review again! |
|
Thanks a bunch for this! I'll roll a new release later today. Feel free to ping me if I forget :) |
|
Sounds like a great plan! That'll be great for unblocking the |
Closes #435 and should just be a patch-level SemVer change!
Currently blocking the removal of
synfromkdl-rss dependency tree, but with this PR merged, that should become rather straightforward!I also found and fixed a bug leading to compilation errors in
ffe374c, some clippy lints, and reused some code in53c8330.I also added tests wherever I was replacing
ErrororDiagnosticderives with something hand-written, just to be sure I wasn't changing any behavior!