Skip to content

Commit dbb8c00

Browse files
committed
cargo dev crater: save all warnings into a file
1 parent 7314133 commit dbb8c00

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clippy_dev/src/crater.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ impl Krate {
9898
.expect("clippy output did not contain \"warning: \"");
9999
let mut new = line[0..pos].to_string();
100100
new.push_str(&line[pos + remove_pat.len()..]);
101+
new.push('\n');
101102
new
102103
})
103104
.collect();
@@ -142,6 +143,7 @@ pub fn run() {
142143

143144
let all_warnings: Vec<String> = clippy_lint_results.into_iter().flatten().collect();
144145

145-
// TODO: save these into a file
146-
all_warnings.iter().for_each(|l| println!("{}", l));
146+
// save the text into mini-crater/logs.txt
147+
let text = all_warnings.join("");
148+
std::fs::write("mini-crater/logs.txt", text).unwrap();
147149
}

0 commit comments

Comments
 (0)