Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assorted typos in docs #1601

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/error/option_unwrap/defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() {

## `get_or_insert()` evaluates eagerly, modifies empty value in place

To make sure that an `Option` contains a value, we can use `get_or_insert` to modify it in place with a fallback value, as is shown in the following example. Note that `get_or_insert` eagerly evaluaes its parameter, so variable `apple` is moved:
To make sure that an `Option` contains a value, we can use `get_or_insert` to modify it in place with a fallback value, as is shown in the following example. Note that `get_or_insert` eagerly evaluates its parameter, so variable `apple` is moved:

```rust,editable
#[derive(Debug)]
Expand All @@ -75,7 +75,7 @@ fn main() {
// my_fruit is: Apple
// first_available_fruit is: Apple
//println!("Variable named `apple` is moved: {:?}", apple);
// TODO: uncomment the line above to see the compliler error
// TODO: uncomment the line above to see the compiler error
}
```

Expand Down
6 changes: 3 additions & 3 deletions src/flow_control/match/guard.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A `match` *guard* can be added to filter the arm.
```rust,editable
enum Temperature {
Celsius(i32),
Farenheit(i32),
Fahrenheit(i32),
}

fn main() {
Expand All @@ -17,8 +17,8 @@ fn main() {
// The `if condition` part ^ is a guard
Temperature::Celsius(t) => println!("{}C is below 30 Celsius", t),

Temperature::Farenheit(t) if t > 86 => println!("{}F is above 86 Farenheit", t),
Temperature::Farenheit(t) => println!("{}F is below 86 Farenheit", t),
Temperature::Fahrenheit(t) if t > 86 => println!("{}F is above 86 Fahrenheit", t),
Temperature::Fahrenheit(t) => println!("{}F is below 86 Fahrenheit", t),
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/std/str.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This way you can add any character to your string, even unprintable ones
and ones that you don't know how to type. If you want a literal backslash,
escape it with another one: `\\`

String or character literal delimiters occuring within a literal must be escaped: `"\""`, `'\''`.
String or character literal delimiters occurring within a literal must be escaped: `"\""`, `'\''`.

```rust,editable
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/unsafe/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ In some cases, fine control is needed over the way a register name is formatted

By default the compiler will always choose the name that refers to the full register size (e.g. `rax` on x86-64, `eax` on x86, etc).

This default can be overriden by using modifiers on the template string operands, just like you would with format strings:
This default can be overridden by using modifiers on the template string operands, just like you would with format strings:

```rust
use std::arch::asm;
Expand Down