1
Fork 0

Rollup merge of #67432 - Mark-Simulacrum:fix-toolstate, r=Centril

Fix toolstate history format

We were inserting *before* the existing newline, so we should prepend it
not append it to our inserted string.
This commit is contained in:
Mark Rousskov 2019-12-19 17:53:57 -05:00 committed by GitHub
commit 8f20e67501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -413,7 +413,7 @@ fn change_toolstate(
let history_path = format!("rust-toolstate/history/{}.tsv", OS.expect("linux/windows only"));
let mut file = t!(fs::read_to_string(&history_path));
let end_of_first_line = file.find('\n').unwrap();
file.insert_str(end_of_first_line, &format!("{}\t{}\n", commit, toolstate_serialized));
file.insert_str(end_of_first_line, &format!("\n{}\t{}", commit, toolstate_serialized));
t!(fs::write(&history_path, file));
}