1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

cp: keep --preserve related code but ignore "unused" warnings

This commit is contained in:
shutefan 2017-10-06 21:54:00 +02:00
parent e1d41b84f3
commit 4a96b56d60

View file

@ -984,6 +984,17 @@ fn copy_file(source: &Path, dest: &Path, options: &Options) -> CopyResult<()> {
println!("{}", context_for(source, dest)); println!("{}", context_for(source, dest));
} }
#[allow(unused)]
{
// TODO: implement --preserve flag
let mut preserve_context = false;
for attribute in &options.preserve_attributes {
if *attribute == Attribute::Context {
preserve_context = true;
}
}
}
match options.copy_mode { match options.copy_mode {
CopyMode::Link => { CopyMode::Link => {
fs::hard_link(source, dest).context(&*context_for(source, dest))?; fs::hard_link(source, dest).context(&*context_for(source, dest))?;