Commit Graph
6036 Commits
Author SHA1 Message Date
Chris Krycho 21fcf73daf Merge pull request #4284 from reitzig/patch-1
Ch. 10.3: clarify language detail
2025-03-20 08:58:15 -06:00
Rick Rainey, CKA,CKS,CKAD,KCNAandChris Krycho 05f17f0d43 Ch. 17: minor typos and link reference (#4286)
Co-authored-by: Chris Krycho <hello@chriskrycho.com>
2025-03-20 08:16:11 -06:00
Raphael f6bd152fa7 Ch. 10.3: clarify language detail
The former phrasing seemed to suggest that we _must not_ annotate types _unless_ there are multiple possibilities.
In fact, we are allowed to add redundant annotations.

Cases where no annotation is needed _despite_ multiple possible types -- e.g. `let n = 8` -- are, presumably, intentionally left out here, so not touching that.
2025-03-18 11:37:14 +01:00
Chris Krycho d3e8ac3ebd Merge pull request #4282 from rust-lang/ch09-module-privacy
Ch. 9: correctly demonstrate privacy with module
2025-03-17 17:19:57 -06:00
Chris Krycho a6bede67a2 Ch. 9: correctly demonstrate privacy with module
The code as actually written *did* conform to the expetaction of the
text, but only because it was in a `lib.rs` file and so in a module
distinct from the scope directly accessible from `main.rs`; as shown in
the text presentation, however, it was not obvious that it was in a
`lib.rs`, and that detail was elided.

Rename the `lib.rs` to `guessing_game.rs` and declare it as a module in
the `main.rs` file, update the `Listing` to name it, and update the text
to call out the creation of the module.
2025-03-17 17:15:42 -06:00
Chris Krycho 6156ff18b2 Merge pull request #4281 from rust-lang/state-option-etc
Ch. 18: correct discussion of delegation in `Post` methods
2025-03-17 17:02:40 -06:00
Chris Krycho 8904592b6f Ch. 18: correct discussion of delegation in Post methods
Fixes #3635
2025-03-17 16:57:53 -06:00
Chris Krycho b660608304 Merge pull request #4165 from rust-lang/tell-folks-abi-ref
Ch. 20: tell folks to see the Reference for more ABI info
2025-03-17 15:12:33 -06:00
Chris Krycho 4b2590f90c Merge branch 'main' into tell-folks-abi-ref 2025-03-17 15:09:41 -06:00
Chris Krycho 39c34443e7 Merge pull request #4256 from km274/ch-10.1-minor-clarifications
Ch 10.1 minor clarifications
2025-03-17 14:20:48 -06:00
Chris Krycho 6dd246c12a Merge pull request #4232 from anu-sin-theta/main
Clarified the misunderstanding b/w crates, module, items
2025-03-17 13:58:12 -06:00
Chris Krycho 828d75c060 Update src/ch02-00-guessing-game-tutorial.md 2025-03-17 13:55:42 -06:00
Chris Krycho ac911c4223 Merge pull request #4280 from rust-lang/fixes-counting-line-simplify
Ferris: always show, even when it’s small
2025-03-17 11:50:24 -06:00
Chris Krycho 8372e56d40 Ferris: always show Ferrises, even if small
Previously, when we incorporated Ferris into the container for the
buttons, we were bringing along the visibility of the buttons even when
it was important to know that the code wouldn’t compile. This changes
that by showing and hiding the buttons themselves rather than their
container.

Fixes #4274
2025-03-17 11:42:44 -06:00
Chris Krycho 9847e79350 Ferris: simplify line counting for size determination
This is a trivial thing, but I found the previous “replace a terminal
newline and then count the rest” rather less than obvious. Make the
logic more explicit and, as a fun bonus, skip allocating an extra string
along the way. (Not that it matters, in this case, but it’s always
nice to make that kind of improvement.)
2025-03-17 11:41:09 -06:00
Chris Krycho fb2d874349 Merge pull request #4279 from rust-lang/mention-std-pin-use
Ch. 17: mention `use std::pin::{Pin, pin};` on introduction
2025-03-17 10:30:29 -06:00
Chris Krycho b021b72eef Ch. 17: mention use std::pin::{Pin, pin}; on introduction
Bonus: drop now-unnecessary `use std::future::Future` bits given it is
now part of the prelude as of the 2024 edition!

Fixes #4275
2025-03-17 10:26:14 -06:00
Chris Krycho 5a762c3516 Merge pull request #4259 from distortedsignal/wildcard_match_file_fail
Persist printing error, NOT ErrorKind
2025-03-17 09:42:46 -06:00
Chris Krycho 90ea905177 Merge pull request #4263 from proski/two-seconds
Typo: "2" should be "2 seconds"
2025-03-13 10:16:02 -06:00
Chris Krycho a59a0229cf Merge pull request #4270 from alannza/main
Ch. 17: fix tiny example consistency issue
2025-03-13 10:07:49 -06:00
Chris Krycho b456af6342 Merge pull request #4261 from rust-lang/dependabot/cargo/listings/ch17-async-await/listing-17-02/ring-0.17.13
Bump ring from 0.17.8 to 0.17.13 in /listings/ch17-async-await/listing-17-02
2025-03-13 08:43:45 -06:00
Chris Krycho 548187272c Merge pull request #4273 from rust-lang/dependabot/cargo/packages/trpl/ring-0.17.14
Bump ring from 0.17.8 to 0.17.14 in /packages/trpl
2025-03-13 08:43:29 -06:00
dependabot[bot] c47894697c Bump ring from 0.17.8 to 0.17.14 in /packages/trpl
Bumps [ring](https://github.com/briansmith/ring) from 0.17.8 to 0.17.14.
- [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md)
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 14:15:56 +00:00
Chris Krycho 70c566fd15 Merge pull request #4272 from rust-lang/nostarch-backports
2024 Print Edition: updates to Word docs and more fixes to Markdown text
2025-03-13 08:14:37 -06:00
Chris Krycho 32494841d6 link2print: *which* reference is repeatedly defined? 2025-03-13 08:11:51 -06:00
Chris Krycho 56ec353290 More changes caught during ↔ backports for print edition 2025-03-13 08:11:51 -06:00
Chris Krycho 02e053cdbb nostarch: update Word documents with revisions from web version 2025-03-12 17:24:28 -06:00
Alan 54245bf9ef Ch. 17: fix tiny example consistency issue 2025-03-11 19:16:00 -07:00
Pavel Roskin c6f57828d7 Typo: "2" should be "2 seconds"
Remove extraneous "also" in the same paragraph.
2025-03-07 23:08:38 -08:00
dependabot[bot] 3303dafa07 Bump ring in /listings/ch17-async-await/listing-17-02
Bumps [ring](https://github.com/briansmith/ring) from 0.17.8 to 0.17.13.
- [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md)
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-07 17:09:22 +00:00
Tom e3c9cf9164 Persist printing error, NOT ErrorKind
Reading through the Rust Book, I found this code that appears to be
trying to take different actions based on the error type. Looking
closer, I realized that the author changed the code (I believe,
unintentionally) to log only the error type instead of the whole
error when certain conditions are met.

This is a simple fix - the wildcard match for `other_error` is
removed, and replaced with a non-binding wildcard, and the panic
is changed to consuming the base error. This is better because it
changes the minimal amount of functionality in the example code
and it refamiliarizes readers with the wildcard matching system.
2025-03-04 14:06:58 -08:00
km274 6c22ad7459 Clarify language explaining how the non-compiling listing would be fixed
"By following the help text’s suggestion, we restrict..." and "...and this example will compile..." imply to the reader that after this paragraph, they can expect to see a corrected code example. This rewording, though somewhat subtle, clarfies how the code example *would* be fixed by following the compiler's help message.
2025-03-03 17:20:48 -06:00
km274 694ec77f32 Remove "we'll fix it later in this chapter" for clarity
"we'll fix it later in this chapter" somewhat implies that a correct code example will be provided later; "later in this chapter" also implies "quite a bit later", when the fix is actually discussed very shortly after the non-compiling code is presented
2025-03-03 17:04:49 -06:00
Chris Krycho 87f3d05ddf nostarch: incorporate latest revisions from web 2025-02-27 15:10:59 -07:00
Chris Krycho 81a976a237 Merge pull request #4249 from rust-lang/social-media-discussion-generic
Ch. 10: Make social media discussion generic.
2025-02-27 15:10:41 -07:00
Chris Krycho e5c8a0c99d Ch. 10: Make social media discussion generic.
Twitter is now X, who knows what 'tweets' are called, and whether *any*
of the current crop of social media platforms will exist by the time the
2027 or 2030 editions of Rust roll around, who knows?
2025-02-27 15:06:51 -07:00
Chris Krycho 0896670829 Merge pull request #4247 from rust-lang/ch-fix-another-chapter-eighteen
Another Ch. 17 -> 18 fix
2025-02-26 13:31:54 -07:00
Chris Krycho 6b65e95005 Another Ch. 17 -> 18 fix 2025-02-26 13:20:28 -07:00
Chris Krycho 814c7e5cf0 Merge pull request #4246 from rust-lang/ch-improve-wording-about-useravailb
Ch. 05: further tweak to wording about `user1` availability
2025-02-26 13:00:49 -07:00
Chris Krycho 063b1f8aff Ch. 05: further tweak to wording about user1 availability
This is a tricky thing to get “just right”, and I am not *totally* happy
with this solution, but I think it’s actually better without the “as a
whole” given the addition of the sentence at the end indicating that its
fields can still be accessed.
2025-02-26 12:52:43 -07:00
Chris Krycho 5fe7297b27 Merge pull request #4245 from rust-lang/fix-rand-version-mistake
Ch. 02: Fix rand version mistake (from testing)
2025-02-25 17:10:54 -07:00
Chris Krycho 3297509511 Ch. 02: Fix rand version mistake (from testing) 2025-02-25 17:06:07 -07:00
Chris Krycho 8f67810d97 Merge pull request #4244 from rust-lang/closures-and-fn-type
Ch. 19: Correct the discussion of `fn` type and closures
2025-02-25 15:57:13 -07:00
Chris Krycho 0ca2482a69 Ch. 19: Correct the discussion of fn type and closures 2025-02-25 15:50:33 -07:00
Chris Krycho 6bb2d00cea Merge pull request #4243 from rust-lang/edition-scripting
Edition maintenance: scripting the updates for future work
2025-02-25 11:45:41 -07:00
Chris Krycho 34820ac2f4 Edition maintenance: scripting the updates for future work 2025-02-25 11:40:19 -07:00
Chris Krycho 34cdd411ea Merge pull request #4242 from rust-lang/fresh-eyes-edits
Ch. 17: fresh-eyes edits
2025-02-25 10:20:45 -07:00
Chris Krycho 2800281fc4 Ch. 17: fresh-eyes edits
Or: what happens when you reread your own work after a couple months
away from it!
2025-02-25 10:10:33 -07:00
Chris Krycho 0133087d4a Merge pull request #4212 from rust-lang/drop-lifetime-unnecessar-in-edition
Ch. 17: drop lifetime not required in 2024 Edition
2025-02-25 10:03:56 -07:00
Chris Krycho 6ae5d86ca2 Ch. 17: drop lifetime not required in 2024 Edition
This makes for a nicely simpler introduction of this feature!
2025-02-25 09:27:14 -07:00