Commit Graph

217 Commits

Author SHA1 Message Date
Carol (Nichols || Goulding) 55f2474e71 Upgrade to rand 0.8.5 2022-10-20 16:39:55 -04:00
vladvel e418c239e8 Fixed incorrect mutex lock usage
Mutex lock spans through job execution, should be in a let statement as in the subsequent full code listing https://github.com/rust-lang/book/blob/main/listings/ch20-web-server/no-listing-07-final-code/src/lib.rs#L72-L74.
2022-08-18 21:12:36 -04:00
JirCep 0e9980e429 Unnecessary import removal
As per my observations crate being subject to integration tests is available for qualified reference without importing it with `use`.
2022-07-30 14:38:08 +02:00
Carol (Nichols || Goulding) 9232dec2d7 Remove inconsistent newline. Fixes #3240. 2022-07-14 21:33:04 -04:00
Carol (Nichols || Goulding) 2fe9eff266
Update to Rust 1.62 2022-07-04 21:17:25 -04:00
Carol (Nichols || Goulding) 92bfbfacf8
Extract where clause example so it'll get rustfmtted in the future 2022-07-04 21:05:33 -04:00
Carol (Nichols || Goulding) 50775360ba Fix listing 8-21. Fixes #3251 2022-07-04 20:36:25 -04:00
Carol (Nichols || Goulding) f490796274
Propagate tech review changes for ch13 2022-07-04 20:14:48 -04:00
Carol (Nichols || Goulding) 9fa6702670
Change some print formatting styles in ch18 2022-06-13 21:05:57 -04:00
Carol (Nichols || Goulding) a488a1b3cf
Tweak rustfmt slightly for these listings 2022-06-10 22:23:12 -04:00
Carol (Nichols || Goulding) d71683d0a8
Println captures in chapter 15 2022-06-04 20:48:52 -04:00
Carol (Nichols || Goulding) 02d3f7b458
Merge branch 'ch14-tr' 2022-06-04 14:29:16 -04:00
Carol (Nichols || Goulding) a0aea4de2a
Use println capture format more in chapter 14 2022-06-04 10:14:44 -04:00
Carol (Nichols || Goulding) 4b43eac27b
Upgrade to Rust 1.61 2022-06-04 09:38:06 -04:00
Carol (Nichols || Goulding) 8d3584f55f
Upgrade to Rust 1.60 2022-06-03 21:39:11 -04:00
Carol (Nichols || Goulding) 02a168ed34
More little improvements to chapter 12
- Change the variable name from filename to file_path. Fixes #3142.
- Use the new println capture. Connects to #3048.
- Use dbg! when appropriate. Connects to #2842.
- Improve the expect message to read better. Connects to #2918.
2022-06-03 21:10:24 -04:00
Carol (Nichols || Goulding) e44d600dd1
Propagate ch12 tech review edits to src 2022-06-03 21:10:24 -04:00
Carol (Nichols || Goulding) 34314c10f6
Propagate ch11 tech review edits to src 2022-06-02 21:16:43 -04:00
Carol (Nichols || Goulding) 9939a14e3b
Adjust listing so error output line numbers match 2022-06-01 21:57:46 -04:00
Carol (Nichols || Goulding) 08d9a51790
Merge remote-tracking branch 'origin/pr/3104' into ch10-tr 2022-06-01 21:37:55 -04:00
Carol (Nichols || Goulding) 4aa96a3d20
Propagate ch10 edits to src 2022-06-01 21:35:13 -04:00
Carol (Nichols || Goulding) 6d1fd7a6ad
Edits in response to tech review 2022-06-01 21:31:01 -04:00
Carol (Nichols || Goulding) 1b99347836
Demonstrate a better expect message. Fixes #2918. 2022-05-30 21:07:29 -04:00
Carol (Nichols || Goulding) a87db22c29
Propagate tech review ch9 edits to src 2022-05-30 21:07:29 -04:00
Carol (Nichols || Goulding) ac16184a7f
Propagate changes for ch8 to src 2022-05-29 20:28:20 -04:00
JirCep eedc18924d
Extra-clarity qualification
Regard the preceding wording “we’ve annotated the types of the values that are returned from these functions for extra clarity.” while only the indexing function is annotated.
2022-05-28 21:01:53 -04:00
Carol (Nichols || Goulding) c76f1b4d01
Propagate tech review edits to ch06 src 2022-05-25 20:53:34 -04:00
Carol (Nichols || Goulding) dd7e052758
Propagate tech review edits to src ch5 2022-05-21 14:29:42 -04:00
Carol (Nichols || Goulding) e68a478801
Drop sender and use that to gracefully shut down workers
Fixes #1910.
2022-05-11 21:14:33 -04:00
Carol (Nichols || Goulding) 5fdb6958c7
Update web server program and explanation
- Improve style
- Use BufReader rather than Read directly
  - Fixes #2237.
  - Fixes #1990.
- Use write_all instead of write
  - Fixes #2058 by removing flush that's a no-op
- Remove redundant complete listings that only added HTML files
2022-05-11 15:43:47 -04:00
Carol (Nichols || Goulding) 1947fa8359
Use write_all instead of write
Connects to #2237. Connects to #1990.
2022-05-06 09:08:08 -04:00
miku86 f023883979 Move hardcoded string into status_line to be consistent 2022-05-05 16:41:55 -04:00
Marvin Löbel 3e6f616f63 fix unidiomatic new functions in chapter 15 2022-04-30 10:14:07 -04:00
Carol (Nichols || Goulding) 3dfbcba0e5
Change polarity and names of variables in env var section
Fixes #1898.
2022-04-27 21:43:42 -04:00
Carol (Nichols || Goulding) c25f7183f2
Fixing chapter 13 listings 2022-04-26 22:17:37 -04:00
Carol (Nichols || Goulding) ce4da5ccbf
Start of a new closure example 2022-04-21 10:33:03 -04:00
Carol (Nichols || Goulding) 4bfc9edbc4
Use impl Iterator instead of std::env::Args
Fixes #2021. Fixes #3052.
2022-04-21 08:56:41 -04:00
Carol (Nichols || Goulding) f63a69e016 Updating chapter 3 to use new println style 2022-04-20 21:30:01 -04:00
Nuno-Mota c2ee07d72f Chapter 3, section 2 - Add explicit type annotation to example of scalar type char. 2022-04-20 21:30:01 -04:00
Aaron Reisman f326ca0fc4 Update main.rs 2022-04-18 19:28:11 -04:00
Carol (Nichols || Goulding) cecf909561 Update to 1.59 2022-03-30 10:15:13 -04:00
Carol (Nichols || Goulding) 4a8924fd5b Edits to chapter 2 after tech review 2022-03-30 10:15:13 -04:00
Guilloux Stephan (Ubuntu) be4dfaa337 Fix #3102 - CH10.2 // 'use aggretaror::' instead of 'use chapter10::'. 2022-03-30 09:31:01 +02:00
Carol (Nichols || Goulding) 1321884718 Rename a separate example of serve_order to deliver_order
To be less confusing and not appear to be related with earlier examples.

Fixes #2659.
2022-03-28 21:54:58 -04:00
Carol (Nichols || Goulding) bd477bc886 Show an example that `use` only applies in its own scope
Rather than showing a `self` path example that's pretty rare.

Fixes #2490. Fixes #2939.
2022-03-28 21:54:58 -04:00
Carol (Nichols || Goulding) 1901760602 quick modules guide 2022-03-28 20:52:19 -04:00
Carol (Nichols || Goulding) 8ffabe0c79
Change variable names from "slice" to "values"
Fixes #2894.
2022-02-21 20:21:18 -05:00
Carol (Nichols || Goulding) 99c373e92c
Remove unnecessary extern crate proc_macro
Fixes #2579.
2022-02-21 19:47:20 -05:00
Alex Hawthorne 10c67b4410 Update Listing 11-1 to reflect current contents 2022-02-21 17:36:12 -05:00
Carol (Nichols || Goulding) 89f8e7b6e7 Change match guard example to actually be unexpressable with patterns alone
Fixes #2868.
2022-02-09 21:52:41 -05:00
Carol (Nichols || Goulding) 727ef100a5
Remove the section on object safety.
Connects to #2790.
2022-01-27 21:34:34 -05:00
Carol (Nichols || Goulding) 4cc38c8f66 Moving example into blockquote means it can't be extracted to a listing project 2022-01-21 22:14:59 -05:00
Carol (Nichols || Goulding) a4efcd52c4 Update to 1.58 2022-01-20 10:21:56 -05:00
Carol (Nichols || Goulding) 3a2941b798
Adjust some more line numbers of Cargo.toml includes 2022-01-07 20:59:55 -05:00
Carol (Nichols || Goulding) 81061d0e8d
Merge remote-tracking branch 'parkerziegler/fix/ch14-add-one-naming' 2022-01-07 20:48:31 -05:00
Carol (Nichols || Goulding) cc958ca579 Use 'static lifetime earlier because that's more correct. Fixes #2864. 2021-12-29 11:06:21 -05:00
Carol (Nichols || Goulding) ab4f04cbe6 Update the edition in all the listings' Cargo.toml 2021-12-26 20:32:41 -05:00
Carol (Nichols || Goulding) 8a0bb3c96e Propagate edits back 2021-12-22 20:54:27 -05:00
Carol (Nichols || Goulding) 5f9358faeb 1.57 2021-12-05 21:33:16 -05:00
Carol (Nichols || Goulding) 5f2729cdc5 Update to 1.56 2021-12-05 21:33:16 -05:00
Carol (Nichols || Goulding) 4b607d12ca
Clarify that traits must be brought into scope to use their methods
Fixes #2801, among other things
2021-11-14 21:49:21 -05:00
Jack Clayton 748b4cd243 Clarify generic types in mixin 2021-11-13 21:29:11 -05:00
Carol (Nichols || Goulding) 3873c1b6bf Update question mark to better explain where it can be used
Fixes #2537.
2021-10-30 21:49:15 -04:00
Carol (Nichols || Goulding) 126aa9faa8
Update to Rust 1.55 2021-09-16 21:01:38 -04:00
Jesse Ruderman 4ecd2750f5 Remove unused variable 2021-09-09 15:49:07 -07:00
Daniel Ceballos 710def409e
Improve the reading of the code
Change in line 3 to improve the reading of the code
2021-08-31 16:14:04 -05:00
parkerziegler ae5651f192 Fix #2583. Rename add-one crate to add_one in chapter 14. 2021-08-17 14:36:52 -07:00
Carol (Nichols || Goulding) 16a17f9362
Demonstrate variable as catch-all for match. Fixes #1868. 2021-08-10 21:27:57 -04:00
Carol (Nichols || Goulding) 340f3c9bbb
Improve the if let example to have a binding pattern. Fixes #1401. 2021-08-10 19:50:44 -04:00
Carol (Nichols || Goulding) 794d33a871
Discuss how struct update syntax moves
Fixes #2789.
2021-08-01 21:24:16 -04:00
Carol (Nichols || Goulding) 70eaf499cd
Clarify that ordering doesn't matter for struct update syntax
Fixes #1996.
2021-08-01 21:09:09 -04:00
Carol (Nichols || Goulding) b4132ae499
Discuss methods that have the same name as a field
Connects to #1740.
2021-08-01 21:05:05 -04:00
Carol (Nichols || Goulding) e8200d27ed
Update to Rust 1.54 2021-07-31 20:15:17 -04:00
Carol (Nichols || Goulding) d9fdb49fb9
Oops, add the command so the output regen script will work 2021-07-31 20:15:16 -04:00
Carol (Nichols || Goulding) 5813399c94
Introduce the dbg macro. Connects to #1658 2021-07-28 21:50:33 -04:00
Carol (Nichols || Goulding) 79085eb920
Add an example of declaring and instantiating unit-like structs. Fixes #2442. 2021-07-28 21:17:08 -04:00
Jade 1c4a1ea4bf Remove authors field from all the listing manifests
Since RFC3052 is fully implemented in Cargo and the various Rust
websites, we can set an example by removing the authors field from all
the listings as it has been effectively soft deprecated.

Follow on/related to #2785, which removed the references in the text.
2021-07-27 19:02:14 -07:00
Carol (Nichols || Goulding) d377d2effa
A few small wording tweaks in ch 4 2021-07-25 21:43:19 -04:00
Carol (Nichols || Goulding) 05d9c4c231
Small edits to chapter 3 2021-07-23 17:02:10 -04:00
Carol (Nichols || Goulding) bfa4e31795
This iter isn't needed anymore! Fixes #2672. 2021-07-21 22:03:45 -04:00
Carol (Nichols || Goulding) 0b942f6be8
Update to Rust 1.53. 2021-07-21 22:03:38 -04:00
Carol (Nichols || Goulding) 82d3b82e10
Address loop labels and continue. Fixes #1392. 2021-07-20 22:03:00 -04:00
Carol (Nichols || Goulding) f40c71fb9a
Clarify behavior of integer division. Fixes #2248. 2021-07-20 21:30:58 -04:00
Carol (Nichols || Goulding) db430c2985
Demonstrate how scope interacts with shadowing
Fixes #2727.
2021-07-20 21:18:17 -04:00
Carol (Nichols || Goulding) 3ce0d7d506
Derive Copy and Clone for Point to match stdlib docs example; fixes #2657 2021-07-13 21:49:57 -04:00
Carol (Nichols || Goulding) 52c2a17e73
Remove some more references to the authors field 2021-07-08 21:03:05 -04:00
Vivek Vinod 1be91682d1
remove the authors field 2021-07-08 12:26:09 +05:30
Carol (Nichols || Goulding) ec5ea9615e
Further clarify and make consistent the reference to deref coercion 2021-07-05 14:05:54 -04:00
Morris Li ffa44f28a6
add usage for `String` reference
https://users.rust-lang.org/t/string-slice-as-parameter-syntax-question/16861

I believe many beginners will also have same problem, so I add the usage and annotations.
2021-07-05 14:05:54 -04:00
Carol (Nichols || Goulding) 05a580c326
Fix code hiding that I broke in eb60fedc9
Pointed out in https://github.com/rust-lang/book/pull/2741
2021-07-05 13:07:17 -04:00
Carol (Nichols || Goulding) 6f9feee64e
Merge pull request #2696 from marekpetak/not-used-ref-confusion 2021-07-03 14:15:47 -04:00
Carol (Nichols || Goulding) 1263e3fad3
Update to 1.52 2021-05-06 22:28:13 -04:00
Carol (Nichols || Goulding) b31140b9fa
Update to 1.51 2021-05-06 20:54:26 -04:00
mattko 6d26493533
changed to 'will not be used'
This should make it clearer that the variables will not be used in the future, hence the rest of the code will work.
2021-04-19 15:00:00 +01:00
mattko 2ac6fdc8b1
Change the comment so its cleaner what author meant 2021-04-15 13:01:21 +01:00
kangxiaoning 475807042f correct the signature of the `deref` method 2021-03-21 21:33:10 +08:00
Carol (Nichols || Goulding) 69e592dcdd
Fix bad regex in the update rustc script and regenerate broken output
Fixes #2595
2021-02-28 21:34:07 -05:00
Carol (Nichols || Goulding) 5bb407aa4a
Remove fancy quote from a code comment
This isn't always recognized as UTF-8 on all platforms after
copy-pasting.

Fixes #2606
Related to #2539, #1307, #1533
2021-02-28 20:33:09 -05:00
Carol (Nichols || Goulding) f207d4125b
Rename shoes_in_my_size to shoes_in_size to be a better example
Fixes #2262.
2021-02-22 20:20:31 -05:00
Carol (Nichols || Goulding) 937b020889
Update one more bit of output caught by the update rust script 2021-02-17 21:28:33 -05:00