Skip to content

Commit d8bd8ef

Browse files
Merge pull request #50 from kimtth/main
fix(docs): correct typos
2 parents 60c8858 + 62da288 commit d8bd8ef

10 files changed

Lines changed: 13 additions & 13 deletions

async-book/src/ch05-the-state-machine-reveal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async fn pipeline(url: &str) -> Result<usize, Error> {
148148
<details>
149149
<summary>🔑 Solution</summary>
150150

151-
Four states:
151+
Five states:
152152

153153
1. **Start** — stores `url`
154154
2. **WaitingFetch** — stores `url`, `fetch` future

c-cpp-book/src/ch03-built-in-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| Unicode | char | 'a', '$' |
1313
| Boolean | bool | true, false |
1414

15-
- Rust permits arbitrarily use of ```_``` between numbers for ease of reading
15+
- Rust permits arbitrary use of ```_``` between numbers for ease of reading
1616
----
1717
### Rust type specification and assignment
1818
- Rust uses the ```let``` keyword to assign values to variables. The type of the variable can be optionally specified after a ```:```
@@ -24,7 +24,7 @@ fn main() {
2424
let z = 42u32;
2525
}
2626
```
27-
- Function parameters and return values (if any) require an explicit type. The following takes an u8 parameter and returns u32
27+
- Function parameters and return values (if any) require an explicit type. The following takes a u8 parameter and returns u32
2828
```rust
2929
fn foo(x : u8) -> u32
3030
{

c-cpp-book/src/ch05-data-structures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn main() {
236236

237237
# Rust tuple structs
238238
- Rust tuple structs are similar to tuples and individual fields don't have names
239-
- Like tuples, individual elements are accessed using .0, .1, .2, .... A common use case for tuple structs is to wrap primitive types to create custom types. **This can useful to avoid mixing differing values of the same type**
239+
- Like tuples, individual elements are accessed using .0, .1, .2, .... A common use case for tuple structs is to wrap primitive types to create custom types. **This can be useful to avoid mixing differing values of the same type**
240240
```rust
241241
struct WeightInGrams(u32);
242242
struct WeightInMilligrams(u32);

c-cpp-book/src/ch08-crates-and-modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Modules are the fundamental organizational unit of code within crates
66
- Each source file (.rs) is its own module, and can create nested modules using the ```mod``` keyword.
77
- All types in a (sub-) module are **private** by default, and aren't externally visible within the same crate unless they are explicitly marked as ```pub``` (public). The scope of ```pub``` can be further restricted to ```pub(crate)```, etc
8-
- Even if an type is public, it doesn't automatically become visible within the scope of another module unless it's imported using the ```use``` keyword. Child submodules can reference types in the parent scope using the ```use super::```
8+
- Even if a type is public, it doesn't automatically become visible within the scope of another module unless it's imported using the ```use``` keyword. Child submodules can reference types in the parent scope using the ```use super::```
99
- Source files (.rs) aren't automatically included in the crate **unless** they are explicitly listed in ```main.rs``` (executable) or ```lib.rs```
1010

1111
# Exercise: Modules and functions
@@ -154,7 +154,7 @@ fn main() {
154154
# Using community crates from crates.io
155155
- Rust has a vibrant ecosystem of community crates (see https://crates.io/)
156156
- The Rust philosophy is to keep the standard library compact and outsource functionality to community crates
157-
- There is no hard and fast rule about using community crates, but the rule of thumb should be ensure that the crate has a decent maturity level (indicated by the version number), and that it's being actively maintained. Reach out to internal sources if in doubt about a crate
157+
- There is no hard and fast rule about using community crates, but the rule of thumb should be to ensure that the crate has a decent maturity level (indicated by the version number), and that it's being actively maintained. Reach out to internal sources if in doubt about a crate
158158
- Every crate published on ```crates.io``` has a major and minor version
159159
- Crates are expected to observe the major and minor ```SemVer``` guidelines defined here: https://doc.rust-lang.org/cargo/reference/semver.html
160160
- The TL;DR version is that there should be no breaking changes for the same minor version. For example, v0.11 must be compatible with v0.15 (but v0.20 may have breaking changes)

c-cpp-book/src/ch09-1-error-handling-best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Let's break down what's happening here. `ConfigError` has just **two variants**
9898
| `FileRead(io::Error)` | The original I/O error | `#[from]` auto-converts via `?` |
9999
| `Invalid { message }` | A human-readable explanation | Your validation code |
100100

101-
Now you can Write functions that return `Result<T, ConfigError>`:
101+
Now you can write functions that return `Result<T, ConfigError>`:
102102

103103
```rust
104104
fn read_config(path: &str) -> Result<String, ConfigError> {

c-cpp-book/src/ch09-error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum Result<T, E> {
3131
# Rust Option type
3232
- The Rust ```Option``` type is an ```enum``` with only two variants: ```Some<T>``` and ```None```
3333
- The idea is that this represents a ```nullable``` type, i.e., it either contains a valid value of that type (```Some<T>```), or has no valid value (```None```)
34-
- The ```Option``` type is used in APIs result of an operation either succeeds and returns a valid value or it fails (but the specific error is irrelevant). For example, consider parsing a string for an integer value
34+
- The ```Option``` type is used in APIs where the result of an operation either succeeds and returns a valid value or it fails (but the specific error is irrelevant). For example, consider parsing a string for an integer value
3535
```rust
3636
fn main() {
3737
// Returns Option<usize>

c-cpp-book/src/ch11-from-and-into-traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> **What you'll learn:** Rust's type conversion traits — `From<T>` and `Into<T>` for infallible conversions, `TryFrom` and `TryInto` for fallible ones. Implement `From` and get `Into` for free. Replaces C++ conversion operators and constructors.
44
55
- ```From``` and ```Into``` are complementary traits to facilitate type conversion
6-
- Types normally implement on the ```From``` trait. the ```String::from()``` converts from "&str" to ```String```, and compiler can automatically derive ```&str.into```
6+
- Types normally implement the ```From``` trait. The ```String::from()``` converts from "&str" to ```String```, and the compiler can automatically derive ```&str.into```
77
```rust
88
struct Point {x: u32, y: u32}
99
// Construct a Point from a tuple

c-cpp-book/src/ch12-1-iterator-power-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn main() {
218218

219219

220220
# Rust iterators
221-
- The ```Iterator``` trait is used to implement iteration over user defined types (https://doc.rust-lang.org/std/iter/trait.IntoIterator.html)
221+
- The ```Iterator``` trait is used to implement iteration over user-defined types (https://doc.rust-lang.org/std/iter/trait.IntoIterator.html)
222222
- In the example, we'll implement an iterator for the Fibonacci sequence, which starts with 1, 1, 2, ... and the successor is the sum of the previous two numbers
223223
- The ```associated type``` in the ```Iterator``` (```type Item = u32;```) defines the output type from our iterator (```u32```)
224224
- The ```next()``` method simply contains the logic for implementing our iterator. In this case, all state information is available in the ```Fibonacci``` structure

c-cpp-book/src/ch12-closures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn main() {
6464
</details>
6565

6666
# Rust iterators
67-
- Iterators are one of the most powerful features of Rust. They enable very elegant methods for perform operations on collections, including filtering (```filter()```), transformation (```map()```), filter and map (```filter_and_map()```), searching (```find()```) and much more
67+
- Iterators are one of the most powerful features of Rust. They enable very elegant methods for performing operations on collections, including filtering (```filter()```), transformation (```map()```), filter and map (```filter_and_map()```), searching (```find()```) and much more
6868
- In the example below, the ```|&x| *x >= 42``` is a closure that performs the same comparison. The ```|x| println!("{x}")``` is another closure
6969
```rust
7070
fn main() {
@@ -355,7 +355,7 @@ fn main() {
355355
----
356356

357357
# Rust iterators
358-
- The ```Iterator``` trait is used to implement iteration over user defined types (https://doc.rust-lang.org/std/iter/trait.IntoIterator.html)
358+
- The ```Iterator``` trait is used to implement iteration over user-defined types (https://doc.rust-lang.org/std/iter/trait.IntoIterator.html)
359359
- In the example, we'll implement an iterator for the Fibonacci sequence, which starts with 1, 1, 2, ... and the successor is the sum of the previous two numbers
360360
- The ```associated type``` in the ```Iterator``` (```type Item = u32;```) defines the output type from our iterator (```u32```)
361361
- The ```next()``` method simply contains the logic for implementing our iterator. In this case, all state information is available in the ```Fibonacci``` structure

engineering-book/src/ch06-dependency-management-and-supply-chain-s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Each duplicate adds compile time and binary size.
267267

268268
### Application: Multi-Crate Dependency Hygiene
269269

270-
The the workspace uses `[workspace.dependencies]` for centralized
270+
The workspace uses `[workspace.dependencies]` for centralized
271271
version management — an excellent practice. Combined with
272272
[`cargo tree --duplicates`](ch07-release-profiles-and-binary-size.md) for size
273273
analysis, this prevents version drift and reduces binary bloat:

0 commit comments

Comments
 (0)