cargo/Readme.md

49 lines
2 KiB
Markdown
Raw Normal View History

2016-07-07 14:49:55 +00:00
# rustfix
[![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.
2016-07-07 14:49:55 +00:00
2018-05-05 16:14:11 +00:00
## Current status
2016-07-07 14:49:55 +00:00
2018-05-15 18:44:32 +00:00
Currently, rustfix is split into two crates:
2016-07-07 14:49:55 +00:00
- `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).
2016-07-07 14:49:55 +00:00
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
2016-07-07 14:49:55 +00:00
2018-05-05 16:14:11 +00:00
[clippy]: https://github.com/rust-lang-nursery/rust-clippy
2016-07-07 14:49:55 +00:00
2018-05-13 15:46:46 +00:00
## Installation
`cargo fix` is a built-in command in Cargo since Rust 1.29. There is no need to install it separately from crates.io.
2018-05-13 15:46:46 +00:00
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
2018-07-20 14:09:44 +00:00
Instructions on how to use this tool to transition a crate to Rust 2021 can be
2018-10-07 07:43:23 +00:00
found [in the Rust Edition Guide.](https://rust-lang-nursery.github.io/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html)
2018-07-20 14:09:44 +00:00
2016-07-07 14:49:55 +00:00
## License
Licensed under either of
2016-07-09 13:28:02 +00:00
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
2016-07-07 14:49:55 +00:00
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.