Skip to content

Commit

Permalink
Fix toolstate history format
Browse files Browse the repository at this point in the history
We were inserting *before* the existing newline, so we should prepend it
not append it to our inserted string.
  • Loading branch information
Mark-Simulacrum committed Dec 19, 2019
1 parent 0de96d3 commit 1787b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/toolstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 1787b2b

Please sign in to comment.