提交 dbb8c002 编写于 作者: M Matthias Krüger

cargo dev crater: save all warnings into a file

上级 73141337
......@@ -98,6 +98,7 @@ fn run_clippy_lints(&self, cargo_clippy_path: &PathBuf) -> Vec<String> {
.expect("clippy output did not contain \"warning: \"");
let mut new = line[0..pos].to_string();
new.push_str(&line[pos + remove_pat.len()..]);
new.push('\n');
new
})
.collect();
......@@ -142,6 +143,7 @@ pub fn run() {
let all_warnings: Vec<String> = clippy_lint_results.into_iter().flatten().collect();
// TODO: save these into a file
all_warnings.iter().for_each(|l| println!("{}", l));
// save the text into mini-crater/logs.txt
let text = all_warnings.join("");
std::fs::write("mini-crater/logs.txt", text).unwrap();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册