From d1db42ff02be274dd387448f9f9ab605206d9338 Mon Sep 17 00:00:00 2001 From: Niko Savola Date: Sun, 4 Sep 2022 02:37:31 +0300 Subject: [PATCH] Fix assorted typos (#1601) --- src/error/option_unwrap/defaults.md | 4 ++-- src/flow_control/match/guard.md | 6 +++--- src/std/str.md | 2 +- src/unsafe/asm.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/error/option_unwrap/defaults.md b/src/error/option_unwrap/defaults.md index eb515aee61..e75493e7e7 100644 --- a/src/error/option_unwrap/defaults.md +++ b/src/error/option_unwrap/defaults.md @@ -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)] @@ -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 } ``` diff --git a/src/flow_control/match/guard.md b/src/flow_control/match/guard.md index 6dba58f138..63008a7431 100644 --- a/src/flow_control/match/guard.md +++ b/src/flow_control/match/guard.md @@ -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() { @@ -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), } } ``` diff --git a/src/std/str.md b/src/std/str.md index 26d8fd1097..a15038b907 100644 --- a/src/std/str.md +++ b/src/std/str.md @@ -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() { diff --git a/src/unsafe/asm.md b/src/unsafe/asm.md index ee6b8088a1..1538bc49db 100644 --- a/src/unsafe/asm.md +++ b/src/unsafe/asm.md @@ -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;