From 9b446bf261d16da3ee8b23a13dc50092261c71f2 Mon Sep 17 00:00:00 2001 From: Joining7943 <111500881+Joining7943@users.noreply.github.com> Date: Sun, 13 Nov 2022 18:20:28 +0100 Subject: [PATCH] tests/tail: Fix clippy warning same-item-push. Do not push same flag twice. --- tests/by-util/test_tail.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index f83b8f470..ee572b1d4 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -2268,7 +2268,7 @@ fn test_follow_name_move2() { let mut args = vec!["--follow=name", file1, file2]; let mut delay = 500; - for _ in 0..2 { + for i in 0..2 { at.truncate(file1, "file1_content\n"); at.truncate(file2, "file2_content\n"); @@ -2291,7 +2291,9 @@ fn test_follow_name_move2() { assert_eq!(buf_stdout, expected_stdout); assert_eq!(buf_stderr, expected_stderr); - args.push("--use-polling"); + if i == 0 { + args.push("--use-polling"); + } delay *= 3; // NOTE: Switch the first and second line because the events come in this order from // `notify::PollWatcher`. However, for GNU's tail, the order between polling and not @@ -2421,7 +2423,7 @@ fn test_follow_name_move_retry2() { let mut args = vec!["-s.1", "--max-unchanged-stats=1", "-F", file1, file2]; let mut delay = 500; - for _ in 0..2 { + for i in 0..2 { at.touch(file1); at.touch(file2); @@ -2451,7 +2453,9 @@ fn test_follow_name_move_retry2() { at.remove(file1); at.remove(file2); - args.push("--use-polling"); + if i == 0 { + args.push("--use-polling"); + } delay *= 3; // NOTE: Switch the first and second line because the events come in this order from // `notify::PollWatcher`. However, for GNU's tail, the order between polling and not