From f6f76a76b2b06c6546bb00117e61f4c743d1eba6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 1 Feb 2023 15:57:02 -0500 Subject: fix(lockfile): emit trailing newline (#17618) --- lockfile/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lockfile/lib.rs') diff --git a/lockfile/lib.rs b/lockfile/lib.rs index ec91def15..b8caac86c 100644 --- a/lockfile/lib.rs +++ b/lockfile/lib.rs @@ -187,7 +187,8 @@ impl Lockfile { return Ok(()); } - let json_string = serde_json::to_string_pretty(&self.content).unwrap(); + let mut json_string = serde_json::to_string_pretty(&self.content).unwrap(); + json_string.push('\n'); // trailing newline in file let mut f = std::fs::OpenOptions::new() .write(true) .create(true) -- cgit v1.2.3