File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! Library for applying diagnostic suggestions to source code.
2
+ //!
3
+ //! This is a low-level library. You pass it the JSON output from `rustc`, and
4
+ //! you can then use it to apply suggestions to in-memory strings. This
5
+ //! library doesn't execute commands, or read or write from the filesystem.
6
+ //!
7
+ //! If you are looking for the [`cargo fix`] implementation, the core of it is
8
+ //! located in [`cargo::ops::fix`].
9
+ //!
10
+ //! [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html
11
+ //! [`cargo::ops::fix`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/fix.rs
12
+ //!
13
+ //! The general outline of how to use this library is:
14
+ //!
15
+ //! 1. Call `rustc` and collect the JSON data.
16
+ //! 2. Pass the json data to [`get_suggestions_from_json`].
17
+ //! 3. Create a [`CodeFix`] with the source of a file to modify.
18
+ //! 4. Call [`CodeFix::apply`] to apply a change.
19
+ //! 5. Write the source back to disk.
20
+
1
21
use std:: collections:: HashSet ;
2
22
use std:: ops:: Range ;
3
23
You can’t perform that action at this time.
0 commit comments