Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 82fb067

Browse files
committed
Print some log information about what's being fixed
1 parent 5f81993 commit 82fb067

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cargo-fix/src/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,15 @@ fn rustfix_crate(rustc: &Path, filename: &str) -> Result<(), Error> {
149149
// we would do with multiple locations.
150150
let (file_name, range) = match suggestion.snippets.get(0) {
151151
Some(s) => (s.file_name.clone(), s.line_range),
152-
None => continue,
152+
None => {
153+
trace!("rejecting as it has no snippets {:?}", suggestion);
154+
continue
155+
}
153156
};
154157
if !suggestion.snippets.iter().all(|s| {
155158
s.file_name == file_name && s.line_range == range
156159
}) {
160+
trace!("rejecting as it spans mutliple files {:?}", suggestion);
157161
continue
158162
}
159163

@@ -171,6 +175,8 @@ fn rustfix_crate(rustc: &Path, filename: &str) -> Result<(), Error> {
171175
warn!("failed to read `{}`: {}", file, e);
172176
continue
173177
}
178+
debug!("applying {} fixes to {}", suggestions.len(), file);
179+
174180
let new_code = rustfix::apply_suggestions(&code, &suggestions);
175181
File::create(&file)
176182
.and_then(|mut f| f.write_all(new_code.as_bytes()))

0 commit comments

Comments
 (0)