From 0dc5d967aeba8a2e0c01092bc4edead2a1056a8b Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 31 Jul 2023 14:39:36 -0700 Subject: [PATCH] working_copy: move a duplicate statement out of `match` block --- lib/src/working_copy.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index eab9f9820..8c74f41d3 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -722,15 +722,10 @@ impl TreeState { ¤t_tree, &new_file_state, )?; - match update { - None => { - self.file_states.insert(sub_path, new_file_state); - } - Some(tree_value) => { - self.file_states.insert(sub_path.clone(), new_file_state); - tree_builder.set(sub_path, tree_value); - } + if let Some(tree_value) = update { + tree_builder.set(sub_path.clone(), tree_value); } + self.file_states.insert(sub_path, new_file_state); } } }