Skip to content

Commit 8e6ee4a

Browse files
authored
Merge pull request #2341 from rust-lang-nursery/steveklabnik-patch-1
Fix installation instructions to use rustup
2 parents 6b19d4d + 9bf8f79 commit 8e6ee4a

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,29 @@ to be a bit out of date). Version 0.1 of rustfmt-nightly is forked from version
2121

2222
## Quick start
2323

24-
You must be using the latest nightly compiler toolchain.
24+
Currently, you can use `rustfmt` on nightly and beta. Rust 1.24 stable will work,
25+
but we're not quite there yet!
2526

2627
To install:
2728

2829
```
29-
cargo install rustfmt-nightly
30+
rustup component add rustfmt-preview --toolchain=nightly
3031
```
3132

33+
If `nightly` is your default toolchain, you can leave the `--toolchain` off.
34+
3235
to run on a cargo project in the current working directory:
3336

3437
```
35-
cargo fmt
38+
cargo +nightly fmt
3639
```
3740

38-
## Installation
39-
40-
```
41-
cargo install rustfmt-nightly
42-
```
41+
If `nightly` is your default toolchain, you can leave off the `+nightly`.
4342

44-
or if you're using [Rustup](https://www.rustup.rs/)
43+
## Installation
4544

4645
```
47-
rustup update
48-
rustup run nightly cargo install rustfmt-nightly
46+
rustup component add rustfmt-preview --toolchain=nightly
4947
```
5048

5149
If you don't have a nightly toolchain, you can add it using rustup:
@@ -63,12 +61,6 @@ rustup default nightly
6361
If you choose not to do that you'll have to run rustfmt using `rustup run ...`
6462
or by adding `+nightly` to the cargo invocation.
6563

66-
Usually cargo-fmt, which enables usage of Cargo subcommand `cargo fmt`, is
67-
installed alongside rustfmt. To only install rustfmt run
68-
69-
```
70-
cargo install --no-default-features rustfmt-nightly
71-
```
7264
## Installing from source
7365

7466
To install from source, first checkout to the tag or branch you want to install, then issue

0 commit comments

Comments
 (0)