Skip to content

Commit 59a6927

Browse files
authored
Merge pull request #1947 from BertramScharpf/bsch
Minor fixes (whitespace, typo, i32->u32)
2 parents 6648bf7 + 3862372 commit 59a6927

Some content is hidden

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

45 files changed

+89
-93
lines changed

po/es.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ msgstr "Sacando `Result`s de `Option`s"
593593

594594
#: src/SUMMARY.md:172 src/error/multiple_error_types/define_error_type.md:1
595595
msgid "Defining an error type"
596-
msgstr "Defniniendo un tipo de error"
596+
msgstr "Definiendo un tipo de error"
597597

598598
#: src/SUMMARY.md:173 src/error/multiple_error_types/boxing_errors.md:1
599599
msgid "`Box`ing errors"

src/crates/using_lib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020
```txt
2121
# Where library.rlib is the path to the compiled library, assumed that it's
2222
# in the same directory here:
23-
$ rustc executable.rs --extern rary=library.rlib && ./executable
23+
$ rustc executable.rs --extern rary=library.rlib && ./executable
2424
called rary's `public_function()`
2525
called rary's `indirect_access()`, that
2626
> called rary's `private_function()`

src/custom_types/enum/c_like.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn main() {
2525
println!("zero is {}", Number::Zero as i32);
2626
println!("one is {}", Number::One as i32);
2727
28-
println!("roses are #{:06x}", Color::Red as i32);
29-
println!("violets are #{:06x}", Color::Blue as i32);
28+
println!("roses are #{:06x}", Color::Red as u32);
29+
println!("violets are #{:06x}", Color::Blue as u32);
3030
}
3131
```
3232

src/custom_types/enum/testcase_linked_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl List {
3333
// `self` has type `&List`, and `*self` has type `List`, matching on a
3434
// concrete type `T` is preferred over a match on a reference `&T`
3535
// after Rust 2018 you can use self here and tail (with no ref) below as well,
36-
// rust will infer &s and ref tail.
36+
// rust will infer &s and ref tail.
3737
// See https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.html
3838
match *self {
3939
// Can't take ownership of the tail, because `self` is borrowed;

src/error/abort_unwind.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The previous section illustrates the error handling mechanism `panic`. Different code paths can be conditionally compiled based on the panic setting. The current values available are `unwind` and `abort`.
44

5-
Building on the prior lemonade example, we explicitly use the panic strategy to exercise different lines of code.
5+
Building on the prior lemonade example, we explicitly use the panic strategy to exercise different lines of code.
66

77
```rust,editable,mdbook-runnable
88
fn drink(beverage: &str) {

src/error/option_unwrap/and_then.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ known in some languages as flatmap, comes in.
99
`and_then()` calls its function input with the wrapped value and returns the result. If the `Option` is `None`, then it returns `None` instead.
1010

1111
In the following example, `cookable_v3()` results in an `Option<Food>`.
12-
Using `map()` instead of `and_then()` would have given an
12+
Using `map()` instead of `and_then()` would have given an
1313
`Option<Option<Food>>`, which is an invalid type for `eat()`.
1414

1515
```rust,editable

src/error/option_unwrap/defaults.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There is more than one way to unpack an `Option` and fall back on a default if i
1010
`or()`is chainable and eagerly evaluates its argument, as is shown in the following example. Note that because `or`'s arguments are evaluated eagerly, the variable passed to `or` is moved.
1111

1212
```rust,editable
13-
#[derive(Debug)]
13+
#[derive(Debug)]
1414
enum Fruit { Apple, Orange, Banana, Kiwi, Lemon }
1515
1616
fn main() {
@@ -27,15 +27,15 @@ fn main() {
2727
// But the variable named `apple` has been moved regardless, and cannot be used anymore.
2828
// println!("Variable apple was moved, so this line won't compile: {:?}", apple);
2929
// TODO: uncomment the line above to see the compiler error
30-
}
30+
}
3131
```
3232

3333
## `or_else()` is chainable, evaluates lazily, keeps empty value intact
3434

3535
Another alternative is to use `or_else`, which is also chainable, and evaluates lazily, as is shown in the following example:
3636

3737
```rust,editable
38-
#[derive(Debug)]
38+
#[derive(Debug)]
3939
enum Fruit { Apple, Orange, Banana, Kiwi, Lemon }
4040
4141
fn main() {
@@ -84,7 +84,7 @@ fn main() {
8484
Instead of explicitly providing a value to fall back on, we can pass a closure to `get_or_insert_with`, as follows:
8585

8686
```rust,editable
87-
#[derive(Debug)]
87+
#[derive(Debug)]
8888
enum Fruit { Apple, Orange, Banana, Kiwi, Lemon }
8989
9090
fn main() {

src/error/result/enter_question_mark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ at older code. The same `multiply` function from the previous example
4444
would look like this using `try!`:
4545

4646
```rust,editable,edition2015
47-
// To compile and run this example without errors, while using Cargo, change the value
47+
// To compile and run this example without errors, while using Cargo, change the value
4848
// of the `edition` field, in the `[package]` section of the `Cargo.toml` file, to "2015".
4949
5050
use std::num::ParseIntError;

src/flow_control/for.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn main() {
7171
_ => println!("Hello {}", name),
7272
}
7373
}
74-
74+
7575
println!("names: {:?}", names);
7676
}
7777
```
@@ -90,7 +90,7 @@ fn main() {
9090
_ => println!("Hello {}", name),
9191
}
9292
}
93-
93+
9494
println!("names: {:?}", names);
9595
// FIXME ^ Comment out this line
9696
}

src/flow_control/if_let.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ fn main() {
7070
let a = Foo::Bar;
7171
let b = Foo::Baz;
7272
let c = Foo::Qux(100);
73-
73+
7474
// Variable a matches Foo::Bar
7575
if let Foo::Bar = a {
7676
println!("a is foobar");
7777
}
78-
78+
7979
// Variable b does not match Foo::Bar
8080
// So this will print nothing
8181
if let Foo::Bar = b {
8282
println!("b is foobar");
8383
}
84-
84+
8585
// Variable c matches Foo::Qux which has a value
8686
// Similar to Some() in the previous example
8787
if let Foo::Qux(value) = c {

0 commit comments

Comments
 (0)