-
Couldn't load subscription status.
- Fork 7
Expose a diffing iterator #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
base: master
Are you sure you want to change the base?
Conversation
This is a step towards publicly exposing it. We do lose the optimization from the last major PR. We should still be better than the original code though.
This is more so making room for other kinds of errors that will be added. BREAKING CHANGE: `is_different` now returns `IoError` instead of `Error`.
Fixes #11 by giving users access to more detailed error information if they use `DirDiff`'s `IntoIter` instead of `is_different`. This makes it possible to workaround several existing issues: - #9 by providing your own line-ending agnostic checks - #6 by providing a file comparison function that handles larger files.
|
@steveklabnik This is a big change. Is it something you're wanting to look at before I submit? |
| } | ||
|
|
||
| /// Returns an error iff one of the two paths does not exist. | ||
| pub fn assert_exists(self) -> Result<Self, AssertionError> { |
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.
These asserts are a it of a pain to work with. Until the other day, I didn't know you could have more complex selfs.
This might be a way to improve things.
Some example use cases
is_differentdifferencecrateYou can look at the implementation of
is_differentto see how simple it is. I have a test branch ofcobaltthat replaces the custom directory diffing with this, augmented to usedifference:Controversial API choices
assertdespite them erroring rather thanpanicing. I wasn't sure of a better namePotential areas for the API to expand
Potential areas for chrome improvement
AssertionError'sDisplayfancyfeature that usesdifferenceString/ UTF-8 is text?