Skip to content

Commit c3f7e54

Browse files
Merge branch 'main' into add_vietnamese
2 parents bcc1636 + 13c4c06 commit c3f7e54

File tree

259 files changed

+7377
-35822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+7377
-35822
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ they only get updated when edits are sent to No Starch. **Do not submit pull
1212
requests changing files in the `nostarch` directory, they will be closed.**
1313

1414
We use [`rustfmt`][rustfmt] to apply standard formatting to Rust code in the
15-
repo and [`dprint`][dprint] to apply standing formatting to the Markdown source
15+
repo and [`dprint`][dprint] to apply standard formatting to the Markdown source
1616
and the non-Rust code in the project.
1717

1818
[rustfmt]: https://github.com/rust-lang/rustfmt

ci/dictionary.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ booleans
5858
Bors
5959
BorrowMutError
6060
BoxMeUp
61+
boxt
6162
BTreeSet
6263
BufRead
6364
BufReader
@@ -167,6 +168,7 @@ eprintln
167168
Erlang
168169
ErrorKind
169170
Español
171+
ETAPS
170172
eval
171173
executables
172174
ExitCode
@@ -343,6 +345,7 @@ mutexes
343345
Mutexes
344346
MutexGuard
345347
mutext
348+
mutextarct
346349
MyAsyncStateMachine
347350
MyBox
348351
myprogram
@@ -376,6 +379,7 @@ OpenGL
376379
optimizations
377380
OptionalFloatingPointNumber
378381
OptionalNumber
382+
optiont
379383
OsStr
380384
OsString
381385
other's
@@ -439,6 +443,7 @@ refactoring
439443
refcell
440444
RefCell
441445
refcellt
446+
refcelltrct
442447
RefMut
443448
reformats
444449
refutability
@@ -455,6 +460,7 @@ retweet
455460
rewordings
456461
rint
457462
ripgrep
463+
Rumbul
458464
runnable
459465
runtime
460466
runtimes
@@ -596,6 +602,7 @@ unsynchronized
596602
Unyank
597603
UpperCamelCase
598604
URIs
605+
urls
599606
UsefulType
600607
username
601608
USERPROFILE
@@ -619,6 +626,7 @@ wasi
619626
wasn
620627
weakt
621628
WeatherForecast
629+
webpage
622630
WebSocket
623631
whitespace
624632
wildcard

listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ pub fn add(left: u64, right: u64) -> u64 {
22
left + right
33
}
44

5+
// ANCHOR: here
56
#[cfg(test)]
67
mod tests {
78
use super::*;
89

9-
// ANCHOR: here
1010
#[test]
1111
fn it_works() -> Result<(), String> {
1212
let result = add(2, 2);
@@ -17,5 +17,5 @@ mod tests {
1717
Err(String::from("two plus two does not equal four"))
1818
}
1919
}
20-
// ANCHOR_END: here
2120
}
21+
// ANCHOR_END: here

listings/ch15-smart-pointers/listing-15-14/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ $ cargo run
22
Compiling drop-example v0.1.0 (file:///projects/drop-example)
33
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.60s
44
Running `target/debug/drop-example`
5-
CustomSmartPointers created.
5+
CustomSmartPointers created
66
Dropping CustomSmartPointer with data `other stuff`!
77
Dropping CustomSmartPointer with data `my stuff`!

listings/ch15-smart-pointers/listing-15-14/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fn main() {
1515
let d = CustomSmartPointer {
1616
data: String::from("other stuff"),
1717
};
18-
println!("CustomSmartPointers created.");
18+
println!("CustomSmartPointers created");
1919
}

listings/ch15-smart-pointers/listing-15-15/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ fn main() {
1313
let c = CustomSmartPointer {
1414
data: String::from("some data"),
1515
};
16-
println!("CustomSmartPointer created.");
16+
println!("CustomSmartPointer created");
1717
c.drop();
18-
println!("CustomSmartPointer dropped before the end of main.");
18+
println!("CustomSmartPointer dropped before the end of main");
1919
}
2020
// ANCHOR_END: here

listings/ch15-smart-pointers/listing-15-16/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ $ cargo run
22
Compiling drop-example v0.1.0 (file:///projects/drop-example)
33
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s
44
Running `target/debug/drop-example`
5-
CustomSmartPointer created.
5+
CustomSmartPointer created
66
Dropping CustomSmartPointer with data `some data`!
7-
CustomSmartPointer dropped before the end of main.
7+
CustomSmartPointer dropped before the end of main

listings/ch15-smart-pointers/listing-15-16/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ fn main() {
1313
let c = CustomSmartPointer {
1414
data: String::from("some data"),
1515
};
16-
println!("CustomSmartPointer created.");
16+
println!("CustomSmartPointer created");
1717
drop(c);
18-
println!("CustomSmartPointer dropped before the end of main.");
18+
println!("CustomSmartPointer dropped before the end of main");
1919
}
2020
// ANCHOR_END: here

listings/ch15-smart-pointers/listing-15-25/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ANCHOR: here
12
use crate::List::{Cons, Nil};
23
use std::cell::RefCell;
34
use std::rc::Rc;
@@ -16,5 +17,6 @@ impl List {
1617
}
1718
}
1819
}
20+
// ANCHOR_END: here
1921

2022
fn main() {}

listings/ch17-async-await/listing-17-04/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use trpl::Html;
66
fn main() {
77
let args: Vec<String> = std::env::args().collect();
88

9-
trpl::run(async {
9+
trpl::block_on(async {
1010
let url = &args[1];
1111
match page_title(url).await {
1212
Some(title) => println!("The title for {url} was {title}"),

0 commit comments

Comments
 (0)