-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Extract code and output; script formatting and updating them #2231
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7a9c8f4
Set cargo new config vars to placeholders for example projects
carols10cents 8b0c216
Script to generate release artifact of just the listings
carols10cents 6579c05
Include code without hidden lines for nostarch files
carols10cents 7945e10
Document administrative tasks that are now scripted
carols10cents 5c71aac
Extract code listings to separate files
carols10cents bc8c9f1
Write a script to update output with a new version of rustc
carols10cents dec27ee
Add rustfmt to the update-rustc script
carols10cents fd3e920
Commit the changes that rustfmt made to all the listings
carols10cents 3648956
Rustfmt our tools too
carols10cents 5f4f738
Update to Rust 1.38
carols10cents 3c34849
Update to Rust 1.39
carols10cents c642b72
Update to Rust 1.40
carols10cents File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
...s/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This listing deliberately doesn't parse so rustfmt fails. |
3 changes: 3 additions & 0 deletions
3
listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 | ||
3 changes: 3 additions & 0 deletions
3
listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
...ings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
...gs/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
3 changes: 3 additions & 0 deletions
3
listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| We have some weird comments pointing out borrowing scopes that we don't want to change; | ||
| unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to | ||
| manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 |
2 changes: 2 additions & 0 deletions
2
listings/ch14-more-about-cargo/output-only-01-adder-crate/add/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| This listing is used for demonstrating how to set up a workspace, but the workspace isn't | ||
| completely set up yet, so rustfmt complains the crate mentioned in Cargo.toml doesn't exist yet. |
1 change: 1 addition & 0 deletions
1
listings/ch18-patterns-and-matching/listing-18-25/rustfmt-ignore
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This listing deliberately doesn't parse so rustfmt fails. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| max_width = 80 |
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
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
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.
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.
ah this is very interesting... this seems good to be honest.