Commit Graph
2456 Commits
Author SHA1 Message Date
Carol (Nichols || Goulding) c2c083cb65 Removing code style around futures; not sure what this refers to 2024-10-01 13:19:30 -04:00
Carol (Nichols || Goulding) f01527c271 Since -> because because none of these are time-based 2024-10-01 13:15:26 -04:00
Carol (Nichols || Goulding) 78679a7888 Clarify why the block only borrows and remove an unneeded word 2024-10-01 12:28:54 -04:00
Carol (Nichols || Goulding) f713c79b4b Put back the invitation to race URLs at the end 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) d34446d51f Correct another instance of an old function name 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) 15f353c1ef Add a trailing comma on the last variant 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) a25f57614e This sounds like 1 call with 2 URLs but it's 2 calls with 1 URL each 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) 9ad373ff7b Correct function name and pronoun number 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) 502adbf520 Be clearer about where we're using trpl::run and what it's running 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) 01f089aa2b Clarify writing what would be tedious, and what changes later would be made 2024-10-01 12:28:53 -04:00
Carol (Nichols || Goulding) 9fca5aa6f4 Add a bit more detail about why we'd want a state machine enum 2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) e4e5a4b016 We haven't added 2 calls yet; remove some text that's jumping ahead 2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) 2f8e266749 Clarify which reason we're talking about and what Rust programs have runtimes 2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) a37e1a73c1 Rust not allowing main to be async isn't due to the first part of the sentence
Change from "so" to "and" to avoid that implication.
2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) f727627808 There is no name argument, but there is a url parameter 2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) e8e0c6beba Introduce the listing more explicitly 2024-10-01 12:28:52 -04:00
Carol (Nichols || Goulding) 8df8d8ecb6 Be more explicit about creating a new project 2024-10-01 12:28:52 -04:00
Chris Krycho aca71b65a1 Ch. 17: correct a missing word 2024-10-01 09:48:54 -06:00
Chris Krycho 7f2d814a7f Merge main into async-chapter 2024-09-26 21:13:21 -06:00
Chris Krycho beac73a818 Ch. 17: introduce diagrams for Pin and Unpin. 2024-09-25 15:17:16 -06:00
Chris Krycho 42b59635d2 Ch. 17: General cleanup and edits to esp. 17.05
- Introduce diagrams into 17.05 to break up the wall of text and make it
  easier to visualize.
- Extract the state machine code to make it easier to reference.
- Standardize on `await` instead of `.await` for inline code references.
- Move note about `race` and `select` up to 17.01 since the text now
  references it there, and update the text in 17.03 to account for
  already having introduced the function.
- Fix up a number of code samples to avoid showing `extern crate trpl;`.
- Rewrite the transition between 17.04 and 17.05 to account for having
  restructured the chapter.
- Rework the example code in 17.05 to refer to the `page_title` example
  from the rewritten 17.01 instead of the (now-removed) `hello`.
- When discussing the `Future::poll` method, explicitly address the `cx`
  parameter: note what it is used for, and then move on.
2024-09-25 08:49:28 -06:00
Pavloslav dd80496a98 Fixed Ukrainian translation link to community repo 2024-09-24 11:52:00 +03:00
Chris Krycho b265249e48 Ch. 17: Fix spelling and internal links 2024-09-23 09:18:06 -06:00
Chris Krycho 573a6ca4ba Ch. 17: fix mdbook test output
This gets CI working again. The problem was basically a mix of a few
silly mistakes:

- Using `include` instead of `rustdoc_include` in several places.
- Having rewritten the listing numbers incorrectly.
2024-09-23 08:55:11 -06:00
Chris Krycho cc5db97693 Ch. 17: rewrite 17.01 with a better example
Add `reqwest` and `scraper` dependencies to the `trpl` crate. Wrap them
in `trpl` re-exports which keep the API surface low.

Rewrite the whole first section to use `race` along with those `trpl`
re-exports to show a more “real” example of async code right form the
start, including actual concurrency, unlike the previous introduction.

Update 17.03 to account for having introduced `race` already, and update
listing numbers for rewritten 17.01.

The *inclues* for them were fixed already, but not these!
2024-09-20 16:46:37 -06:00
Ciro Lo Sapio 33d5efb32e translations: remove broken link 2024-09-20 10:44:51 +02:00
Chris Krycho ccafd066cb Ch. 17: Fix some typos! 2024-09-13 17:02:21 -06:00
453247c790 Ch. 17: address Tim and Carol's outstanding comments
Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
2024-09-13 16:20:42 -06:00
Chris Krycho c35b7d9453 Ch. 17: address most of the rest of Carol's outstanding comments 2024-09-13 14:15:37 -06:00
Chris KrychoandJames Munns c4d02bf83b Ch. 17: address the rest of James’ review comments 🎉
Co-authored-by: James Munns <james@onevariable.com>
2024-09-12 17:30:04 -06:00
1d3517ce99 Ch. 17: integrate a number of the outstanding review comments
Bonus: fix some style guide issues, too!

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: James Munns <james@onevariable.com>
Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
2024-09-12 15:27:52 -06:00
Chris Krycho 6bdf1b71f3 Merge main into async-edits 2024-09-12 12:20:35 -06:00
Chris Krycho 7da825f835 Ch. 17: Make the new 17.05 actually work as a deep dive! 2024-09-12 12:20:35 -06:00
Chris Krycho 0d8da8bae2 Ch. 17: fold together 17.03 and 17.04 2024-09-12 12:20:35 -06:00
Chris Krycho 68049c6e15 Ch. 17: rework 17.05 with my own edits and analysis
Along with the wording and phrasing-level edits, pull out a fair bit of
material for the “advanced” section at the end, specifically the details
of what `Stream` and `StreamExt` actually do.
2024-09-12 11:40:54 -06:00
Chris Krycho 97902d50a7 Ch. 17: rework 17.04 with my own edits and analysis
This does *not* yet incorporate any of the relevant feedback from Carol
on this, so a couple spots are still pretty messy.
2024-09-12 11:40:54 -06:00
Chris Krycho 3cfdf2d66a Ch. 17: rework 17.03 (and overall structure) from my own analysis 2024-09-12 11:40:54 -06:00
Chris Krycho 9b13b95ca1 Upgrade Ch. 17 listings for Rust 1.81 2024-09-12 11:40:54 -06:00
Chris Krycho 487c81df35 Merge main into async-edits (Rust 1.81 update) 2024-09-12 11:40:54 -06:00
Chris Krycho cd12a1e853 Ch. 17: more edits for first three sections
These make up *most* of the rest of the edits I caught while rereading
which are not *major structural revisions*, along with some of the bits
required for those major structural revisions.
2024-09-12 11:40:54 -06:00
Chris Krycho c552952e9f Ch. 17: rename trpl::block_on to trpl::run
The `block_on` name is what both Tokio and smol use, but it is a bit
obscure from the point of view of introducing this material. `run` says
much more clearly what it does *for the level we care about here*, I
think.
2024-09-12 11:40:54 -06:00
Chris Krycho e2b72463bc Merge pull request #4025 from ficcialfaint/cargo-init
Add `cargo init` usage suggestion to 1.3
2024-09-11 16:59:50 -06:00
Chris Krycho 28a24440b1 Merge pull request #4024 from bin-wang/remove-mut
Use immutable borrow of `TcpStream` when creating `BufReader`
2024-09-11 16:54:33 -06:00
Chris Krycho 299fd1f3e1 Clarify Cargo.toml generation with cargo init. 2024-09-11 16:53:38 -06:00
Chris Krycho 6b6b4501f1 Upgrade to Rust 1.81
In addition to the baseline changes, skip over non-directory code where
directories are needed to deal with things like `.DS_Store` files. Also
add a bunch of context on error causes from `std::io::Error` because it
was *impossible* to figure out exactly what the source of those were.
2024-09-11 07:26:31 -06:00
Chris Krycho 1de14c81c6 Ch. 17: start restructuring chapter
- Create a section (which will be deleted or at least reintegrated once
  all is said and done) to hold content pulled out of other sections for
  the sake of clearer flow and understanding.
- Pull “advanced” material from 17.00, 17.01, and 17.02 into the holding
  section and start reorganizing their content to account for shifting
  around materials.
2024-09-03 09:11:22 -06:00
faint ef4a51843e cargo init usage suggestion 2024-08-31 20:38:53 +03:00
Bin Wang c648c0e8da Use immutable borrow of TcpStream when creating BufReader 2024-08-30 16:40:55 -04:00
Chris Krycho f812ed07c6 Ch. 17§00: second round of edits 2024-08-24 08:26:08 -06:00
Chris Krycho a42f27bd55 Ch. 17: Fix up diagrams
- Set their view boxes to the original height and width, so they are
  guaranteed to present correctly.
- For Figure 17-02, use the trick of adding a hidden node and hidden
  arrow to it in “Task 2” to align the two boxes.
2024-08-24 08:19:35 -06:00