-
Notifications
You must be signed in to change notification settings - Fork 7
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
Expose a diffing iterator #17
Open
epage
wants to merge
7
commits into
assert-rs:master
Choose a base branch
from
epage:iter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
epage
commented
Feb 11, 2018
} | ||
|
||
/// 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 self
s.
This might be a way to improve things.
This was referenced May 28, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some example use cases
is_different
difference
crateYou can look at the implementation of
is_different
to see how simple it is. I have a test branch ofcobalt
that replaces the custom directory diffing with this, augmented to usedifference
:Controversial API choices
assert
despite them erroring rather thanpanic
ing. I wasn't sure of a better namePotential areas for the API to expand
Potential areas for chrome improvement
AssertionError
'sDisplay
fancy
feature that usesdifference
String
/ UTF-8 is text?