Commit Graph
1609 Commits
Author SHA1 Message Date
Carol (Nichols || Goulding) eaec4ca3ce Merge pull request #2601 from heilmoli/master 2021-02-10 14:30:05 -05:00
Carol (Nichols || Goulding) ebb817e97f Merge remote-tracking branch 'origin/pr/2589' 2021-02-10 13:30:00 -05:00
Carol (Nichols || Goulding) e535032e17 Fix text wrapping
Yes, yes, hobgoblins, I know
2021-02-10 09:27:25 -05:00
Carol (Nichols || Goulding) e631c39e83 Some small rewordings I noticed while rereading just now 2021-02-09 21:30:45 -05:00
Carol (Nichols || Goulding) 64797533ec Merge pull request #2592 from timrobertsdev/master 2021-02-08 21:08:03 -05:00
Carol (Nichols || Goulding) 6bc9fde380 Merge pull request #2581 from apogeeoak/grammar
Removed 'of' between type alias in Ch 19-04.
2021-02-06 09:42:38 -05:00
Carol (Nichols || Goulding) 7bea3e6d23 Merge remote-tracking branch 'origin/pr/2554' 2021-02-06 09:40:00 -05:00
Oliver Heilmann ac4faae07f fixed ferris in ch03-02 - code now compiles but panics 2021-02-01 21:47:41 +00:00
Timothy Roberts 58ac9ea03b Fix typo in ch-20-01-single-threaded.md 2021-01-31 02:47:26 -05:00
apogeeoak 395c1b8c2e Added Content-Length header to Ch 20-01 listings. 2021-01-26 16:30:20 -05:00
apogeeoak 2873cc9762 Fixed typo in Ch 19-04. 2021-01-21 17:16:47 -05:00
Steve Klabnik e724bd8265 Merge pull request #2566 from rust-lang/outsmarting-the-smartypants-compiler
Fixes #2417. Get the index from user input instead of a const.
2021-01-20 08:19:49 -06:00
Carol (Nichols || Goulding) 9e30688e0a Turn off the playground in a bunch more lib.rs inclusions
Missed these spots in eb60fed :(

Fixes #2560.
2021-01-13 22:16:59 -05:00
Carol (Nichols || Goulding) 2485f9023b Update to 1.49 2021-01-12 22:05:36 -05:00
Carol (Nichols || Goulding) 79bafdc6be Fixes #2417. Get the index from user input instead of a const.
The compiler has gotten sufficiently smart regarding const evaluation to
catch many trivial instances of array-index-out-of-bounds at compile
time. However, the compiler can't read peoples' minds... yet.
2021-01-12 21:26:29 -05:00
ThatsNoMoon 71d41266ed Improve compile failure question mark
This improves the contrast of the question mark in the compile failure ferris icon by adding a white border. This way the question mark is visible in both light and dark themes.
2021-01-02 22:20:49 -07:00
Carol (Nichols || Goulding) 77092be1eb Merge pull request #2534 from HollowMan6/patch-1
Fix grammar in ch13-01-closures.md
2020-12-22 21:27:29 -05:00
Carol (Nichols || Goulding) fc9ca867ea Merge remote-tracking branch 'origin/pr/2527' 2020-12-22 21:16:07 -05:00
Carol (Nichols || Goulding) 1fdea76d94 Fix link added in #2495 to be relative and at the bottom 2020-12-22 21:05:28 -05:00
Carol (Nichols || Goulding) cf1c3d3b64 Merge remote-tracking branch 'origin/pr/2495' 2020-12-22 21:03:12 -05:00
Hollow Man acfbeb3659 Fix grammar in ch13-01-closures.md
in to -> into
2020-12-20 22:53:43 +08:00
Carol (Nichols || Goulding) 5bb44f8b5b Make some further edits to #2447 2020-12-18 20:07:31 -05:00
Carol (Nichols || Goulding) 77e1f2ae93 Merge remote-tracking branch 'origin/pr/2447' 2020-12-18 20:05:01 -05:00
Carol (Nichols || Goulding) d7b29fa9c3 Remove copied and dangling link brackets 2020-12-18 19:58:08 -05:00
Carol (Nichols || Goulding) 5b2bd2b3c7 Merge remote-tracking branch 'origin/pr/2359' 2020-12-18 19:56:41 -05:00
apogeeoak 44f928374f Remove leftover reference in Ch 16-03. 2020-12-17 10:01:51 -05:00
Steve Klabnik b702f3bb15 Merge pull request #1752 from rust-lang/gh1744
Remove an uneeded 'static lifetime
2020-12-14 10:24:47 -06:00
Carol (Nichols || Goulding) b4e5fcc554 Fixes #2330. Clarify why the lock is held too long 2020-12-13 21:09:07 -05:00
Carol (Nichols || Goulding) 4275162b3f Explain that we do need to have 'static now 2020-12-10 22:12:51 -05:00
Carol (Nichols || Goulding) 0b81c3bd0c Remove an unneeded link 2020-12-10 22:12:45 -05:00
Carol (Nichols || Goulding) def6530bfa I think this code formatted string literal should include the quotes 2020-12-10 22:12:23 -05:00
Steve Klabnik 360960eb3f Remove an uneeded 'static lifetime
Fixes #1744
2020-12-10 22:11:40 -05:00
Carol (Nichols || Goulding) 15b20d3c6d Merge pull request #2304 from rashiq/rashiq-chapter-1.2-rusftmt
Update paragraph about rustfmt in Chapter 1.2
2020-12-10 21:30:28 -05:00
Carol (Nichols || Goulding) 015d14864d Clarify language around further from #2418 2020-12-10 21:27:22 -05:00
Carol (Nichols || Goulding) 1686f99a22 Merge remote-tracking branch 'origin/pr/2418' 2020-12-10 21:21:37 -05:00
Carol (Nichols || Goulding) b34bb93b2d Add some further edits to #2433 2020-12-09 21:50:40 -05:00
Carol (Nichols || Goulding) 14e2174a58 Merge remote-tracking branch 'origin/pr/2433' 2020-12-09 21:48:41 -05:00
Carol (Nichols || Goulding) 6b111ac28e Note all the method families to handle integer overflow 2020-12-09 21:45:27 -05:00
Carol (Nichols || Goulding) c120b9f2cd Merge remote-tracking branch 'origin/pr/2405' 2020-12-09 21:35:12 -05:00
Carol (Nichols || Goulding) cdb13945ac Fix #1855 - incorporate new reference cycle diagram 2020-12-09 21:30:50 -05:00
Carol (Nichols || Goulding) d28183f901 Make some further edits to the changes in #1886 2020-12-09 21:30:13 -05:00
Carol (Nichols || Goulding) ea49874970 Merge remote-tracking branch 'origin/pr/1886' 2020-12-09 21:14:53 -05:00
Carol (Nichols || Goulding) 8a1aad812b Make some further edits to #1998 2020-12-09 21:01:59 -05:00
Carol (Nichols || Goulding) 5afb67affe Merge remote-tracking branch 'origin/pr/1998' 2020-12-09 21:00:10 -05:00
Carol (Nichols || Goulding) 322899b375 Re-fix #2516 - Make a new listing for final code of ch 20
I was trying to reuse too much; we don't want the `take(2)` to be part
of the final code, but we do want it to be in the listing for the
example where we shut down gracefully after 2 requests.
2020-12-08 21:30:00 -05:00
Carol (Nichols || Goulding) eb60fedc9c A solution for empty main in lib.rs, I think!
The reasons we needed empty `fn main() {}`s were twofold:

- Avoid confusing people when they click the "expand" button on the code
listing and see the auto-main wrapping
- Avoid failing doctests when running `mdbook test` that don't work when
rustdoc wraps a code listing in main

I think I have a solution that mostly solves these cases.

I don't know why this didn't occur to me before. Here's my current
thinking in case these assumptions turn out to be wrong:

There are a [few things that tell mdbook to disable the
main-wrapping][mdbook], and I hadn't noticed one of them until now: if
you annotate a code block with `noplayground`, it won't add a `main`
around it (and it also won't have the "play" button in the upper right
that runs the block and inserts the result into the page).

So instead of putting an empty `fn main() {}` at the bottom of
src/lib.rs files that doesn't make sense, annotate those listings with
`noplayground`. I don't think anyone will miss the play button anyway
because:

- The play button doesn't run tests, so there wasn't any output for
these examples anyway
- If an example doesn't compile, we have it marked `ignore` so that it
doesn't make the tests fail, and `ignore` also disables the play button,
so there isn't a way to see compiler errors either

In most of these cases, `mdbook test` that runs these as doctests will
still wrap these in main, but the tests still pass.

There are some cases, mostly around modules and using `crate::` that
won't pass as doctests when wrapped in main. For those, I've annotated
them with the [undocumented][] [`test_harness`][] attribute that apparently
I was using at some point and then [stopped using][] and now I've
decided to use again, but maybe send in a PR to rust-lang/rust to
change the name to `no_main` and document it or something. In any case,
that shouldn't affect readers at all.

[mdbook]: https://github.com/rust-lang/mdBook/blob/d0deee90b04068ed949f524bb682a47fa26f2218/src/renderer/html_handlebars/hbs_renderer.rs#L805-L808
[undocumented]: https://github.com/rust-lang/rust/issues/42288#issuecomment-309661382
[`test_harness`]: https://github.com/rust-lang/rust/blob/220352781c2585f0efb07ab0e758b136514de5b8/src/librustdoc/doctest.rs#L252
[stopped using]: https://github.com/rust-lang/book/pull/1233#discussion_r175515585
2020-12-08 21:30:00 -05:00
Carol (Nichols || Goulding) 359895c6b2 Manual regeneration of output at 1.48 2020-12-05 14:18:31 -05:00
Carol (Nichols || Goulding) 4cd410bab6 Update to 1.48 2020-12-05 14:18:30 -05:00
Carol (Nichols || Goulding) 2567c35e84 Update to Rust 1.47 2020-12-05 14:18:30 -05:00
Carol (Nichols || Goulding) 4895996a3f Update to 1.46 2020-12-05 14:18:30 -05:00