Implement Error and Display for all error enums by using thiserror#420
Conversation
Also do some minor tweaks to the way errors are represented, and add basic integration tests for errors, to give a feel for how the errors behave. Fixes trishume#94
So we can add new error variants without semver breakage.
|
@trishume Hi, just a heads-up that this soon has been open for more than a month, and as per #382 (comment) I plan to merge this early next week. Let me know if you want more time for review, that is no problem at all. I am comfortable to merge this without review though because I consider it "obviously an improvement", and the changes to the public API are small, and when there is a change, it is obvious for clients what to do. In fact, I've been working on a tool lately to diff changes to public APIs of Rust libraries. Here are the exact changes this PR does to the public API: which gives this output (manually cleaned up a bit) each line represents a public item in the syntect API. - means "removed" and + means "added". So the deprecated Disclaimer: The tool is still work in progress so I would not trust my life with it, but it gives a good indication at least. |
trishume
left a comment
There was a problem hiding this comment.
Great PR! Sorry for leaving it for so long, this would indeed have been totally fine to merge on your own after a month. I moved cities and started a new job this month so I've been busy.
Also do some minor tweaks to the way errors are represented, and add basic integration tests for errors, to give a feel for how the errors behave. In general the backwards compatibility for clients should be good. As the docs for
thiserrorstates (emphasis mine):I.e. the code I remove should be implemented by the new
Errorderive.Also mark all error enums as
#[non_exhaustive]so we can add new error variants without semver breakage in the future.Fixes #94
FWIW,
bathas been usingthiserrorfor 5 months without any issues so far.