From 9054a24fb70970edd2df05ca644c6e68049f1972 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sun, 10 Mar 2024 13:55:49 +0100 Subject: [PATCH 1/2] pr: fix deprecation warnings & remove comment --- tests/by-util/test_pr.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_pr.rs b/tests/by-util/test_pr.rs index af3c41f1bd1..823f0718f4b 100644 --- a/tests/by-util/test_pr.rs +++ b/tests/by-util/test_pr.rs @@ -26,13 +26,12 @@ fn file_last_modified_time(ucmd: &UCommand, path: &str) -> String { } fn all_minutes(from: DateTime, to: DateTime) -> Vec { - let to = to + Duration::minutes(1); - // const FORMAT: &str = "%b %d %H:%M %Y"; + let to = to + Duration::try_minutes(1).unwrap(); let mut vec = vec![]; let mut current = from; while current < to { vec.push(current.format(DATE_TIME_FORMAT).to_string()); - current += Duration::minutes(1); + current += Duration::try_minutes(1).unwrap(); } vec } From 0579233b2d4aa3102b2c31185b7c39d79ae63a18 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sun, 10 Mar 2024 13:56:31 +0100 Subject: [PATCH 2/2] chgrp: fix clippy warning --- tests/by-util/test_chgrp.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/by-util/test_chgrp.rs b/tests/by-util/test_chgrp.rs index be364d1f623..eca5ba0edff 100644 --- a/tests/by-util/test_chgrp.rs +++ b/tests/by-util/test_chgrp.rs @@ -124,10 +124,8 @@ fn test_preserve_root_symlink() { ] { let (at, mut ucmd) = at_and_ucmd!(); at.symlink_file(d, file); - let expected_error = format!( - "chgrp: it is dangerous to operate recursively on 'test_chgrp_symlink2root' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n", - //d, - ); + let expected_error = + "chgrp: it is dangerous to operate recursively on 'test_chgrp_symlink2root' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n"; ucmd.arg("--preserve-root") .arg("-HR") .arg("bin")