|
5 | 5 |
|
6 | 6 | Rustfix is a library defining useful structures that represent fix suggestions from rustc.
|
7 | 7 |
|
8 |
| -## Current status |
| 8 | +This is a low-level library. You pass it the JSON output from `rustc`, and you can then use it to apply suggestions to in-memory strings. This library doesn't execute commands, or read or write from the filesystem. |
9 | 9 |
|
10 |
| -Currently, rustfix is split into two crates: |
| 10 | +If you are looking for the [`cargo fix`] implementation, the core of it is located in [`cargo::ops::fix`]. |
11 | 11 |
|
12 |
| -- `rustfix`, a library for consuming and applying suggestions in the format that `rustc` outputs (this crate) |
13 |
| -- `cargo-fix`, a binary that works as cargo subcommand and that end users will use to fix their code (maintained in the [cargo](https://github.com/rust-lang/cargo/blob/master/src/bin/cargo/commands/fix.rs) repo). |
14 |
| - |
15 |
| - |
16 |
| -The library (and therefore this repo) is considered largely feature-complete. This is because: |
17 |
| -* There is no compiler or even rust-specific logic here |
18 |
| -* New lints and suggestions come from the Rust compiler (and external lints, like [clippy]). |
19 |
| -* `rustfix` doesn't touch the filesystem to implement fixes, or read from disk |
20 |
| - |
21 |
| -[clippy]: https://github.com/rust-lang-nursery/rust-clippy |
22 |
| - |
23 |
| -## Installation |
24 |
| - |
25 |
| -`cargo fix` is a built-in command in Cargo since Rust 1.29. There is no need to install it separately from crates.io. |
26 |
| - |
27 |
| -To use the rustfix library for use in your own fix project, add it to your `Cargo.toml`. |
28 |
| - |
29 |
| -## Using `cargo fix --edition` to transition to Rust 2021 |
30 |
| - |
31 |
| -Instructions on how to use this tool to transition a crate to Rust 2021 can be |
32 |
| -found [in the Rust Edition Guide.](https://rust-lang-nursery.github.io/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html) |
| 12 | +[`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html |
| 13 | +[`cargo::ops::fix`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/fix.rs |
33 | 14 |
|
34 | 15 | ## License
|
35 | 16 |
|
|
0 commit comments