From abc7312dbc12a2d35c630953c100b28ac624a4bf Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 10 Aug 2023 16:21:58 -0700 Subject: [PATCH] working_copy: avoid an unused variable on Windows --- lib/src/working_copy.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 35bb01fed..29676d52e 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -999,7 +999,7 @@ impl TreeState { let executable = *executable; #[cfg(windows)] let executable = { - let _ = executable; + let () = executable; // use the variable false }; self.write_conflict_to_store(repo_path, disk_path, conflict_id.clone(), executable) @@ -1009,12 +1009,14 @@ impl TreeState { let id = self.write_file_to_store(repo_path, disk_path)?; // On Windows, we preserve the executable bit from the current tree. #[cfg(windows)] - let executable = + let executable = { + let () = executable; // use the variable if let Some(TreeValue::File { id: _, executable }) = current_tree_value { executable } else { false - }; + } + }; Ok(TreeValue::File { id, executable }) } FileType::Symlink => {