From c70cc1921c7739a406b052b9d2af8643343e7313 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Fri, 18 Oct 2024 09:08:07 +0200 Subject: [PATCH 1/2] Fix warnings from write_with_newline lint --- tests/integration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 5619b1a..c2ef299 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -691,12 +691,12 @@ mod cmp { let a_path = tmp_dir.path().join("a"); let mut a = File::create(&a_path).unwrap(); - write!(a, "{}c\n", "a".repeat(1024)).unwrap(); + writeln!(a, "{}c", "a".repeat(1024)).unwrap(); a.flush().unwrap(); let b_path = tmp_dir.path().join("b"); let mut b = File::create(&b_path).unwrap(); - write!(b, "{}c\n", "b".repeat(1024)).unwrap(); + writeln!(b, "{}c", "b".repeat(1024)).unwrap(); b.flush().unwrap(); let mut cmd = Command::cargo_bin("diffutils")?; From 1910cbfe5866649fdf121ae3966db82664e7a2a3 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Fri, 18 Oct 2024 09:10:03 +0200 Subject: [PATCH 2/2] Fix warnings from needless_borrow lint --- tests/integration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index c2ef299..c11726e 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -851,12 +851,12 @@ mod cmp { let a_path = tmp_dir.path().join("a"); let mut a = File::create(&a_path).unwrap(); - a.write_all(&bytes).unwrap(); + a.write_all(bytes).unwrap(); a.write_all(b"A").unwrap(); let b_path = tmp_dir.path().join("b"); let mut b = File::create(&b_path).unwrap(); - b.write_all(&bytes).unwrap(); + b.write_all(bytes).unwrap(); b.write_all(b"B").unwrap(); let mut cmd = Command::cargo_bin("diffutils")?;