mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #6054 from cakebaker/pr_chgrp_fix_warnings
pr/chgrp: fix warnings
This commit is contained in:
commit
da9682da7a
2 changed files with 4 additions and 7 deletions
|
@ -124,10 +124,8 @@ fn test_preserve_root_symlink() {
|
||||||
] {
|
] {
|
||||||
let (at, mut ucmd) = at_and_ucmd!();
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
at.symlink_file(d, file);
|
at.symlink_file(d, file);
|
||||||
let expected_error = format!(
|
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",
|
"chgrp: it is dangerous to operate recursively on 'test_chgrp_symlink2root' (same as '/')\nchgrp: use --no-preserve-root to override this failsafe\n";
|
||||||
//d,
|
|
||||||
);
|
|
||||||
ucmd.arg("--preserve-root")
|
ucmd.arg("--preserve-root")
|
||||||
.arg("-HR")
|
.arg("-HR")
|
||||||
.arg("bin")
|
.arg("bin")
|
||||||
|
|
|
@ -26,13 +26,12 @@ fn file_last_modified_time(ucmd: &UCommand, path: &str) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn all_minutes(from: DateTime<Utc>, to: DateTime<Utc>) -> Vec<String> {
|
fn all_minutes(from: DateTime<Utc>, to: DateTime<Utc>) -> Vec<String> {
|
||||||
let to = to + Duration::minutes(1);
|
let to = to + Duration::try_minutes(1).unwrap();
|
||||||
// const FORMAT: &str = "%b %d %H:%M %Y";
|
|
||||||
let mut vec = vec![];
|
let mut vec = vec![];
|
||||||
let mut current = from;
|
let mut current = from;
|
||||||
while current < to {
|
while current < to {
|
||||||
vec.push(current.format(DATE_TIME_FORMAT).to_string());
|
vec.push(current.format(DATE_TIME_FORMAT).to_string());
|
||||||
current += Duration::minutes(1);
|
current += Duration::try_minutes(1).unwrap();
|
||||||
}
|
}
|
||||||
vec
|
vec
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue