mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
install: run rustfmt
Fix formatting issues based on PR review comments
This commit is contained in:
parent
8471088d6d
commit
406cd865eb
2 changed files with 12 additions and 7 deletions
|
@ -13,7 +13,7 @@ mod mode;
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
|
||||||
use clap::{App, Arg, ArgMatches};
|
use clap::{App, Arg, ArgMatches};
|
||||||
use filetime::{FileTime, set_file_times};
|
use filetime::{set_file_times, FileTime};
|
||||||
use uucore::entries::{grp2gid, usr2uid};
|
use uucore::entries::{grp2gid, usr2uid};
|
||||||
use uucore::perms::{wrap_chgrp, wrap_chown, Verbosity};
|
use uucore::perms::{wrap_chgrp, wrap_chown, Verbosity};
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ fn behavior(matches: &ArgMatches) -> Result<Behavior, i32> {
|
||||||
owner: matches.value_of(OPT_OWNER).unwrap_or("").to_string(),
|
owner: matches.value_of(OPT_OWNER).unwrap_or("").to_string(),
|
||||||
group: matches.value_of(OPT_GROUP).unwrap_or("").to_string(),
|
group: matches.value_of(OPT_GROUP).unwrap_or("").to_string(),
|
||||||
verbose: matches.is_present(OPT_VERBOSE),
|
verbose: matches.is_present(OPT_VERBOSE),
|
||||||
preserve_timestamps: matches.is_present(OPT_PRESERVE_TIMESTAMPS)
|
preserve_timestamps: matches.is_present(OPT_PRESERVE_TIMESTAMPS),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,10 +565,9 @@ fn copy(from: &PathBuf, to: &PathBuf, b: &Behavior) -> Result<(), ()> {
|
||||||
let accessed_time = FileTime::from_last_access_time(&meta);
|
let accessed_time = FileTime::from_last_access_time(&meta);
|
||||||
|
|
||||||
match set_file_times(to.as_path(), accessed_time, modified_time) {
|
match set_file_times(to.as_path(), accessed_time, modified_time) {
|
||||||
Ok(_) => {},
|
Ok(_) => {}
|
||||||
Err(e) => show_info!("{}", e)
|
Err(e) => show_info!("{}", e),
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.verbose {
|
if b.verbose {
|
||||||
|
|
|
@ -324,8 +324,14 @@ fn test_install_preserve_timestamps() {
|
||||||
let file1_metadata = at.metadata(file1);
|
let file1_metadata = at.metadata(file1);
|
||||||
let file2_metadata = at.metadata(file2);
|
let file2_metadata = at.metadata(file2);
|
||||||
|
|
||||||
assert_eq!(file1_metadata.accessed().ok(), file2_metadata.accessed().ok());
|
assert_eq!(
|
||||||
assert_eq!(file1_metadata.modified().ok(), file2_metadata.modified().ok());
|
file1_metadata.accessed().ok(),
|
||||||
|
file2_metadata.accessed().ok()
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
file1_metadata.modified().ok(),
|
||||||
|
file2_metadata.modified().ok()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// These two tests are failing but should work
|
// These two tests are failing but should work
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue