Skip to content

Commit f8072ac

Browse files
authored
Merge pull request #179 from integer32llc/small-fixes
Small fixes
2 parents 68c458b + 3dfe038 commit f8072ac

12 files changed

+18
-14
lines changed

src/editions/transitioning-an-existing-project-to-a-new-edition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ It's re-written our code to introduce a parameter name for that trait object.
4747
In this case, since it had no name, `cargo fix` will replace it with `_`,
4848
which is conventional for unused variables.
4949

50-
`cargo fix` is still pretty new, and so it can't always fix your code automatically.
50+
`cargo fix` can't always fix your code automatically.
5151
If `cargo fix` can't fix something, it will print the warning that it cannot fix
5252
to the console. If you see one of these warnings, you'll have to update your code
5353
manually. See the corresponding section of this guide for help, and if you have

src/rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.md

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

33
![Minimum Rust version: 1.16](https://img.shields.io/badge/Minimum%20Rust%20Version-1.16-brightgreen.svg)
44

5-
`cargo check` is a new subcommand should speed up the development
5+
`cargo check` is a new subcommand that should speed up the development
66
workflow in many cases.
77

88
What does it do? Let's take a step back and talk about how `rustc` compiles

src/rust-2018/cargo-and-crates-io/cargo-new-defaults-to-a-binary-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
We try to keep Cargo’s CLI quite stable, but this change is important, and is
77
unlikely to cause breakage.
88

9-
For some background, cargo new accepts two flags: `--lib`, for creating
9+
For some background, `cargo new` accepts two flags: `--lib`, for creating
1010
libraries, and `--bin`, for creating binaries, or executables. If you don’t
1111
pass one of these flags, it used to default to `--lib`. At the time, we made
1212
this decision because each binary (often) depends on many libraries, and so

src/rust-2018/cargo-and-crates-io/cargo-rustc-for-passing-arbitrary-flags-to-rustc.md

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

88
For example, Cargo does not have a way to pass unstable flags built-in. But
99
if we'd like to use `print-type-sizes` to see what layout information our
10-
types have. We can run this:
10+
types have, we can run this:
1111

1212
```console
1313
$ cargo rustc -- -Z print-type-sizes
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Cargo and crates.io
22

33
[check]: cargo-check-for-faster-checking.md
4+
[cratesio]: https://crates.io
45

5-
In this chapter of the guide, we discuss a few improvements to `cargo` and crates.io.
6+
In this chapter of the guide, we discuss a few improvements to `cargo` and [crates.io][cratesio].
67
A notable addition here is the new [`cargo check`][check] command.

src/rust-2018/control-flow/loops-can-break-with-a-value.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ rather than statements. `loop` stuck out as strange in this way, as it was
2323
previously a statement.
2424

2525
For now, this only applies to `loop`, and not things like `while` or `for`.
26-
It's not clear yet, but we may add this to those in the future.
26+
See the rationale for this decision in RFC issue [#1767](https://github.com/rust-lang/rfcs/issues/1767).

src/rust-2018/data-types/inclusive-ranges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![Minimum Rust version: 1.26](https://img.shields.io/badge/Minimum%20Rust%20Version-1.26-brightgreen.svg)
44

55
Since well before Rust 1.0, you’ve been able to create exclusive ranges with
6-
.. like this:
6+
`..` like this:
77

88
```
99
for i in 1..3 {

src/rust-2018/module-system/path-clarity.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Finally, on nightly, you'll need it for crates like:
9191
One other use for `extern crate` was to import macros; that's no longer needed.
9292
Check [the macro section](../macros/macro-changes.md) for more.
9393

94+
#### Renaming crates
95+
9496
If you've been using `as` to rename your crate like this:
9597

9698
```rust,ignore
@@ -109,7 +111,7 @@ use self::f::Future;
109111

110112
This change will need to happen in any module that uses `f`.
111113

112-
### The `crate` keyword refers to the current crate.
114+
### The `crate` keyword refers to the current crate
113115

114116
In `use` declarations and in other code, you can refer to the root of the
115117
current crate with the `crate::` prefix. For instance, `crate::foo::bar` will

src/rust-2018/the-compiler/incremental-compilation-for-faster-compiles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ compilation is that you only need to compile the code you’ve actually
1212
changed, which means that that second build is faster.
1313

1414
This is now turned on by default. This means that your builds should be
15-
faster! Don’t forget about cargo check when trying to get the lowest possible
15+
faster! Don’t forget about `cargo check` when trying to get the lowest possible
1616
build times.
1717

1818
This is still not the end story for compiler performance generally, nor

src/rust-2018/trait-system/dyn-trait-for-trait-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ is sometimes slower, and often cannot be used at all when its alternatives can.
3636

3737
Furthermore, with `impl Trait` arriving, "`impl Trait` vs `dyn Trait`" is much
3838
more symmetric, and therefore a bit nicer, than "`impl Trait` vs `Trait`".
39-
`impl Trait` is explained [here](impl-trait-for-returning-complex-types-with-ease.md)
39+
`impl Trait` is explained [here](impl-trait-for-returning-complex-types-with-ease.md).
4040

4141
In the new edition, you should therefore prefer `dyn Trait` to just `Trait`
4242
where you need a trait object.

src/rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn foo<T: Trait>(x: T) {
124124
```
125125

126126
When you call it, you set the type, `T`. "you" being the caller here. This
127-
signature says "I accept any type that implements Trait." ("any type" ==
127+
signature says "I accept any type that implements `Trait`." ("any type" ==
128128
universal in the jargon)
129129

130130
This version:
@@ -154,7 +154,7 @@ type... anyway, you can see how `F` is in the return position here. So you
154154
have the ability to choose.
155155

156156
With `impl Trait`, you're saying "hey, some type exists that implements this
157-
trait, but I'm not gonna tell you what it is.". So now, the caller can't
157+
trait, but I'm not gonna tell you what it is." So now, the caller can't
158158
choose, and the function itself gets to choose. If we tried to define parse
159159
with `Result<impl F,...` as the return type, it wouldn't work.
160160

src/rust-2018/trait-system/more-container-types-support-trait-objects.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ fn main() {
2424

2525
This code would not work with Rust 1.0, but now works.
2626

27-
> If you haven't seen the `dyn` syntax before, see the section on it. For
28-
> versions that do not support it, replace `Rc<dyn Foo>` with `Rc<Foo>`.
27+
> If you haven't seen the `dyn` syntax before, see [the section on
28+
> it](dyn-trait-for-trait-objects.md). For versions that do not support it, replace `Rc<dyn Foo>`
29+
> with `Rc<Foo>`.

0 commit comments

Comments
 (0)