From 1787b2b5aba0231ce26a05c4f7a2d6caf8263f0c Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Thu, 19 Dec 2019 13:48:36 -0500 Subject: [PATCH] Fix toolstate history format We were inserting *before* the existing newline, so we should prepend it not append it to our inserted string. --- src/bootstrap/toolstate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs index a6d9ef38e57..7e547c7799b 100644 --- a/src/bootstrap/toolstate.rs +++ b/src/bootstrap/toolstate.rs @@ -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)); }