Add a couple of example programs#15
Open
sourcefrog wants to merge 2 commits intogitpatch-rs:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds two example programs to demonstrate the library's functionality when working with different patch formats.
- Adds
reproduce.rsexample that parses patches from a file or stdin and reprints them - Adds
dump.rsexample that parses patches and outputs their debug representation - Optimizes a test in
ast.rsby replacingvec![]with an array literal
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/reproduce.rs | New example program that reads and reprints patches to verify parsing/formatting round-trips |
| examples/dump.rs | New example program that displays the debug representation of parsed patches for inspection |
| src/ast.rs | Minor optimization in test code using array literal instead of vec![] macro |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
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.
I found these helpful when trying this library out on different diffs.