Skip to content

Commit 8bede1b

Browse files
authored
Merge pull request #1888 from ShapelessCat/minor-improvements
Minor improvements
2 parents 4dafcae + 0e22153 commit 8bede1b

Some content is hidden

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

92 files changed

+242
-205
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ book
22

33
po/messages.pot
44

5+
.vscode/
6+
57
# Auto-generated files from macOS
68
.DS_Store

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ abide by the [Rust code of conduct], which you can find at that link or in the
1010

1111
## License
1212

13-
RBE is dual licenced under the MIT and Apache 2.0 licenses, and so are all
13+
RBE is dual licensed under the MIT and Apache 2.0 licenses, and so are all
1414
contributions. Please see the [`LICENSE-MIT`] and [`LICENSE-APACHE`] files in
1515
this directory for more details.
1616

@@ -55,7 +55,7 @@ $ mdbook build
5555

5656
**The following warnings can be ignored safely.**
5757

58-
```
58+
```text
5959
[WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "gettext" preprocessor installed?
6060
[WARN] (mdbook::preprocess::cmd): Command: mdbook-gettext
6161
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ read all content offline, however!
2626

2727
**The following warnings can be ignored safely.**
2828

29-
```
29+
```text
3030
[WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "gettext" preprocessor installed?
3131
[WARN] (mdbook::preprocess::cmd): Command: mdbook-gettext
3232
```

TRANSLATING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \
3737
msginit -i po/messages.pot -l xx -o po/xx.po
3838
```
3939

40-
#### Updating the exising translation resource
40+
#### Updating the existing translation resource
4141

4242
```bash
4343
msgmerge --update po/xx.po po/messages.pot

src/attribute.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ can be used to/for:
1717
Attributes look like `#[outer_attribute]` or `#![inner_attribute]`,
1818
with the difference between them being where they apply.
1919

20-
- `#[outer_attribute]` applies to the [item][item] immediately
20+
* `#[outer_attribute]` applies to the [item][item] immediately
2121
following it. Some examples of items are: a function, a module
2222
declaration, a constant, a structure, an enum. Here is an example
2323
where attribute `#[derive(Debug)]` applies to the struct
2424
`Rectangle`:
25+
2526
```rust
2627
#[derive(Debug)]
2728
struct Rectangle {
@@ -30,11 +31,12 @@ with the difference between them being where they apply.
3031
}
3132
```
3233

33-
- `#![inner_attribute]` applies to the enclosing [item][item] (typically a
34+
* `#![inner_attribute]` applies to the enclosing [item][item] (typically a
3435
module or a crate). In other words, this attribute is interpreted as
3536
applying to the entire scope in which it's placed. Here is an example
3637
where `#![allow(unused_variables)]` applies to the whole crate (if
3738
placed in `main.rs`):
39+
3840
```rust
3941
#![allow(unused_variables)]
4042

src/cargo/deps.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,5 @@ rebuilds what it has not already built, similar to `make`).
9191

9292
Voila! That's all there is to it!
9393

94-
9594
[manifest]: https://doc.rust-lang.org/cargo/reference/manifest.html
9695
[dependencies]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html

src/cargo/test.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
As we know testing is integral to any piece of software! Rust has first-class
44
support for unit and integration testing ([see this
5-
chapter](https://doc.rust-lang.org/book/ch11-00-testing.html) in
6-
TRPL).
5+
chapter](https://doc.rust-lang.org/book/ch11-00-testing.html) in TRPL).
76

87
From the testing chapters linked above, we see how to write unit tests and
98
integration tests. Organizationally, we can place unit tests in the modules they
@@ -20,13 +19,13 @@ foo
2019
└── my_other_test.rs
2120
```
2221

23-
Each file in `tests` is a separate
22+
Each file in `tests` is a separate
2423
[integration test](https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests),
2524
i.e. a test that is meant to test your library as if it were being called from a dependent
2625
crate.
2726

28-
The [Testing][testing] chapter elaborates on the three different testing styles:
29-
[Unit][unit_testing], [Doc][doc_testing], and [Integration][integration_testing].
27+
The [Testing][testing] chapter elaborates on the three different testing styles:
28+
[Unit][unit_testing], [Doc][doc_testing], and [Integration][integration_testing].
3029

3130
`cargo` naturally provides an easy way to run all of your tests!
3231

@@ -71,7 +70,7 @@ test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
7170
```
7271

7372
One word of caution: Cargo may run multiple tests concurrently, so make sure
74-
that they don't race with each other.
73+
that they don't race with each other.
7574

7675
One example of this concurrency causing issues is if two tests output to a
7776
file, such as below:
@@ -120,6 +119,7 @@ mod tests {
120119
```
121120

122121
Although the intent is to get the following:
122+
123123
```shell
124124
$ cat ferris.txt
125125
Ferris
@@ -133,7 +133,9 @@ Corro
133133
Corro
134134
Corro
135135
```
136+
136137
What actually gets put into `ferris.txt` is this:
138+
137139
```shell
138140
$ cargo test test_file && cat ferris.txt
139141
Corro

src/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compatibility
22

3-
The Rust language is fastly evolving, and because of this certain compatibility
3+
The Rust language is evolving rapidly, and because of this certain compatibility
44
issues can arise, despite efforts to ensure forwards-compatibility wherever
55
possible.
66

src/conversion/from_into.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ fn main() {
7373

7474
`From` and `Into` are designed to be complementary.
7575
We do not need to provide an implementation for both traits.
76-
If you have implemented the `From` trait for your type, `Into` will call it
77-
when necessary. Note, however, that the converse is not true: implementing `Into` for your type will not automatically provide it with an implementation of `From`.
76+
If you have implemented the `From` trait for your type, `Into` will call it
77+
when necessary. Note, however, that the converse is not true: implementing `Into` for your type will not automatically provide it with an implementation of `From`.
7878

7979
```rust,editable
8080
use std::convert::From;

src/conversion/string.md

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

55
To convert any type to a `String` is as simple as implementing the [`ToString`]
66
trait for the type. Rather than doing so directly, you should implement the
7-
[`fmt::Display`][Display] trait which automagically provides [`ToString`] and
7+
[`fmt::Display`][Display] trait which automatically provides [`ToString`] and
88
also allows printing the type as discussed in the section on [`print!`][print].
99

1010
```rust,editable

0 commit comments

Comments
 (0)