From 4a96b56d60bd6709ad8057f0edbfc5b097aa252f Mon Sep 17 00:00:00 2001 From: shutefan Date: Fri, 6 Oct 2017 21:54:00 +0200 Subject: [PATCH] cp: keep --preserve related code but ignore "unused" warnings --- src/cp/cp.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cp/cp.rs b/src/cp/cp.rs index 3e83b26cd..fc51df701 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -984,6 +984,17 @@ fn copy_file(source: &Path, dest: &Path, options: &Options) -> CopyResult<()> { 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 { CopyMode::Link => { fs::hard_link(source, dest).context(&*context_for(source, dest))?;