-
Notifications
You must be signed in to change notification settings - Fork 21
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
Clever Challenge - Rust #10
Open
Tormyst
wants to merge
18
commits into
MathieuNls:master
Choose a base branch
from
Tormyst:master
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
Also implemented += on result as part of this change.
This method has none of the diff checking properties, it was just ensuring that we read the directory for all diffs that need to be checked. They are temporaraly stored in the set of found files.
RustFmt got lazy and forgot these changes earlier.
Implemented an increment for regions in Result. With that, region calculation is done
This checks what line came before the decide what to do next. Work in progress as there are states that are as of yet unfiled. Work in progress as documentation is not added yet to the new struct
Deleted files and empty file were supported here.
src/diff.rs can now be found in two parts: src/diff/mod.rs holds the front facing part of the module. src/diff/diff_type.rs holds the type parcing and state machine logic
Adding regex and lazy static to facilitate easy use of the parcing system for each line. The regex used could be replaced without effecting much of the outer system. Seeing as anywhere else, filenames are repeated, using the header seems like a good enough solution for the task that can be quickly exteneded.
The way this is done is throug regex of a single line to find A bunch of word characters followed by an open bracket.
Printing takes time. Printing a lot takes longer. This is a split of the print time from the compute time.
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.
Hope that you like this. If I had more time, I would have added more unit tests.