Skip to content

Commit

Permalink
Anchor internal links to the root of the book & Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
synaestheory committed Dec 17, 2018
1 parent 9c48d95 commit 50cfb87
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ $ cargo install mdbook

### Building

To build the book, do this:

The most straight-forward way to build and view the book locally is to use the following command:
```bash
$ mdbook build
$ mdbook serve
```

The output will be in the `book` subdirectory. To check it out, open it in
your web browser.
This serves the book at http://localhost:3000, and rebuilds it on changes.
You can now view the book in your web browser. If you make changes to the book's source code,
you should only need to refresh your browser to see them.

_Firefox:_

```shell
$ firefox book/index.html # Linux
$ open -a "Firefox" book/index.html # OS X
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
$ start firefox.exe .\book\index.html # Windows (Cmd)
$ firefox http://localhost:3000 # Linux
$ open -a "Firefox" http://localhost:3000 # OS X
$ Start-Process "firefox.exe" http://localhost:3000 # Windows (PowerShell)
$ start firefox.exe http://localhost:3000 # Windows (Cmd)
```

_Chrome:_

```shell
$ google-chrome book/index.html # Linux
$ open -a "Google Chrome" book/index.html # OS X
$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
$ start chrome.exe .\book\index.html # Windows (Cmd)
$ google-chrome http://localhost:3000 # Linux
$ open -a "Google Chrome" http://localhost:3000 # OS X
$ Start-Process "chrome.exe" http://localhost:3000 # Windows (PowerShell)
$ start chrome.exe http://localhost:3000 # Windows (Cmd)
```

To run the tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Foo {
```

This code uses an anonymous parameter, that `Box<Foo>`. This is [not
supported in Rust 2018](rust-2018/trait-system/no-anon-params.html), and
supported in Rust 2018](/rust-2018/trait-system/no-anon-params.html), and
so this would fail to compile. Let's get this code up to date!

## Updating your code to be compatible with the new edition
Expand Down Expand Up @@ -89,7 +89,7 @@ trait Foo {
```

In Rust 2018, it's considered idiomatic to use the [`dyn`
keyword](rust-2018/trait-system/dyn-trait-for-trait-objects.html) for
keyword](/rust-2018/trait-system/dyn-trait-for-trait-objects.html) for
trait objects.

Eventually, we want `cargo fix` to fix all these idioms automatically in the same
Expand Down
2 changes: 1 addition & 1 deletion src/rust-2018/cargo-and-crates-io/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cargo and crates.io

[check]: rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html
[check]: /rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html

In this chapter of the guide, we discuss a few improvements to `cargo` and crates.io.
A notable addition here is the new [`cargo check`][check] command.
2 changes: 1 addition & 1 deletion src/rust-2018/control-flow/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Control flow

[async_await]: rust-2018/control-flow/async-await-for-easier-concurrency.html
[async_await]: /rust-2018/control-flow/async-await-for-easier-concurrency.html

In this chapter of the guide, we discuss a few improvements to control flow.
The most notable of these *will* be [`async` and `await`][async_await].
2 changes: 1 addition & 1 deletion src/rust-2018/data-types/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Data types

[fis]: rust-2018/data-types/field-init-shorthand.html
[fis]: /rust-2018/data-types/field-init-shorthand.html

In this chapter of the guide, we discuss a few improvements to data types.
One of these are [field-init-shorthand][fis].
2 changes: 1 addition & 1 deletion src/rust-2018/documentation/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation

[sec_ed]: rust-2018/documentation/new-editions-of-the-book.html
[sec_ed]: /rust-2018/documentation/new-editions-of-the-book.html

In this chapter of the guide, we discuss a few improvements to documentation.
A notable addition here is the [second edition of "the book"][sec_ed].
2 changes: 1 addition & 1 deletion src/rust-2018/error-handling-and-panics/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Error handling and Panics

[qop]: rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html
[qop]: /rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html

In this chapter of the guide, we discuss a few improvements to error handling
in Rust. The most notable of these is [the introduction of the `?` operator][qop].
2 changes: 1 addition & 1 deletion src/rust-2018/macros/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Macros

[custom-derive]: rust-2018/macros/custom-derive.html
[custom-derive]: /rust-2018/macros/custom-derive.html

In this chapter of the guide, we discuss a few improvements to the macro system.
A notable addition here is the introduction of [custom derive macros][custom-derive].
2 changes: 1 addition & 1 deletion src/rust-2018/module-system/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module system

[path clarity changes]: rust-2018/module-system/path-clarity.html
[path clarity changes]: /rust-2018/module-system/path-clarity.html

In this chapter of the guide, we discuss a few changes to the module system.
The most notable of these are the [path clarity changes].
2 changes: 1 addition & 1 deletion src/rust-2018/module-system/path-clarity.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Finally, on nightly, you'll need it for crates like:
#### Macros

One other use for `extern crate` was to import macros; that's no longer needed.
Check [the macro section](rust-2018/macros/macro-changes.html) for more.
Check [the macro section](/rust-2018/macros/macro-changes.html) for more.

If you've been using `as` to rename your crate like this:

Expand Down
2 changes: 1 addition & 1 deletion src/rust-2018/ownership-and-lifetimes/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ownership and lifetimes

[dmbm]: rust-2018/ownership-and-lifetimes/default-match-bindings.html
[dmbm]: /rust-2018/ownership-and-lifetimes/default-match-bindings.html

In this chapter of the guide, we discuss a few improvements to ownership and lifetimes.
One of the most notable of these is [default match binding modes][dmbm].
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ impl<T> Drop for SetOnDrop<'_, T> {
}
```

[the anonymous lifetime]: rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.html
[the anonymous lifetime]: /rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.html
2 changes: 1 addition & 1 deletion src/rust-2018/platform-and-target-support/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Platform and target support

[libcore]: rust-2018/platform-and-target-support/libcore-for-low-level-rust.html
[libcore]: /rust-2018/platform-and-target-support/libcore-for-low-level-rust.html

In this chapter of the guide, we discuss a few improvements to platform and target support.
A notable addition to it was [that the `libcore` library now works on stable Rust][libcore].
2 changes: 1 addition & 1 deletion src/rust-2018/rustdoc/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `rustdoc`

[cf]: rust-2018/rustdoc/documentation-tests-can-now-compile-fail.html
[cf]: /rust-2018/rustdoc/documentation-tests-can-now-compile-fail.html

In this chapter of the guide, we discuss a few improvements to `rustdoc`.
A notable addition to it was [that documentation tests can now compile-fail][cf].
2 changes: 1 addition & 1 deletion src/rust-2018/the-compiler/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The compiler

[errors]: rust-2018/the-compiler/improved-error-messages.html
[errors]: /rust-2018/the-compiler/improved-error-messages.html

In this chapter of the guide, we discuss a few improvements to the compiler.
A notable addition here is our new and [improved error messages][errors].
2 changes: 1 addition & 1 deletion src/rust-2018/trait-system/dyn-trait-for-trait-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ is sometimes slower, and often cannot be used at all when its alternatives can.

Furthermore, with `impl Trait` arriving, "`impl Trait` vs `dyn Trait`" is much
more symmetric, and therefore a bit nicer, than "`impl Trait` vs `Trait`".
`impl Trait` is explained [here](rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html)
`impl Trait` is explained [here](/rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html)

In the new edition, you should therefore prefer `dyn Trait` to just `Trait`
where you need a trait object.
2 changes: 1 addition & 1 deletion src/rust-2018/trait-system/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Trait system

[impl_trait]: rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html
[impl_trait]: /rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html

In this chapter of the guide, we discuss a few improvements to the trait system.
The most notable of these is [`impl Trait`][impl_trait].

0 comments on commit 50cfb87

Please sign in to comment.