From c249c973c463de7a44c342362618e2f429df42d4 Mon Sep 17 00:00:00 2001 From: 3tilley <1138504+3tilley@users.noreply.github.com> Date: Sun, 15 Oct 2023 17:25:03 +0100 Subject: [PATCH 1/3] README update aiming to clarify things for less experienced rustaceans --- Readme.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 541b9d4..924733c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,24 +1,31 @@ # rustfix -The goal of this tool is to read and apply the suggestions made by rustc. +[![Latest Version](https://img.shields.io/crates/v/rustfix.svg)](https://crates.io/crates/rustfix) +[![Rust Documentation](https://docs.rs/rustfix/badge.svg)](https://docs.rs/rustfix) + +Rustfix is a library defining useful structures that represent fix suggestions from rustc ## Current status Currently, rustfix is split into two crates: -- `rustfix`, a library for consuming and applying suggestions in the format that `rustc` outputs -- and `cargo-fix`, a binary that works as cargo subcommand and that end users will use to fix their code. +- `rustfix`, a library for consuming and applying suggestions in the format that `rustc` outputs (this crate) +- `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/cargo/ops/fix.rs) repo). + -The magic of rustfix is entirely dependent on the diagnostics implemented in the Rust compiler (and external lints, like [clippy]). +The library (and therefore this repo) is considered largely feature-complete. This is because: +* There is no compiler or even rust-specific logic here +* New lints and suggestions come from the Rust compiler (and external lints, like [clippy]). +* `rustfix` doesn't touch the filesystem to implement fixes, or read from disk [clippy]: https://github.com/rust-lang-nursery/rust-clippy ## Installation -To use the rustfix library, add it to your `Cargo.toml`. - To get the tool to automatically fix warnings in, run `cargo install cargo-fix`. This will give you `cargo fix`. +To use the rustfix library for use in your own fix project, add it to your `Cargo.toml`. + ## Using `cargo fix --edition` to transition to Rust 2021 Instructions on how to use this tool to transition a crate to Rust 2021 can be From b416b98fabec98c2daed8caf8252d19d1962379d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 15 Oct 2023 19:51:10 -0700 Subject: [PATCH 2/3] Update Readme.md Co-authored-by: Weihang Lo --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 924733c..d2c4447 100644 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,7 @@ The library (and therefore this repo) is considered largely feature-complete. Th ## Installation -To get the tool to automatically fix warnings in, run `cargo install cargo-fix`. This will give you `cargo fix`. +`cargo fix` is a built-in command in Cargo since Rust 1.29. There is no need to install it separately from crates.io. To use the rustfix library for use in your own fix project, add it to your `Cargo.toml`. From 7806962967931453c3422d2336a999bfe5878a02 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 15 Oct 2023 19:51:19 -0700 Subject: [PATCH 3/3] Update Readme.md Co-authored-by: Weihang Lo --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index d2c4447..fe0748f 100644 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ [![Latest Version](https://img.shields.io/crates/v/rustfix.svg)](https://crates.io/crates/rustfix) [![Rust Documentation](https://docs.rs/rustfix/badge.svg)](https://docs.rs/rustfix) -Rustfix is a library defining useful structures that represent fix suggestions from rustc +Rustfix is a library defining useful structures that represent fix suggestions from rustc. ## Current status