From 78da5596b7202c75c0df956e144b697727ca096e Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 26 Apr 2022 20:59:07 -0700 Subject: [PATCH] working_copy: switch an `if let Some() { } else { }` to a `match` --- lib/src/working_copy.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 4fd6b762c..6de403974 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -387,16 +387,17 @@ impl TreeState { // optimize it to check exactly the already-tracked files (we know that // we won't have to consider new files in the directory). let first_file_in_dir = dir.join(&RepoPathComponent::from("\0")); - if let Some((subdir_file, _)) = self + match self .file_states .range((Bound::Included(&first_file_in_dir), Bound::Unbounded)) .next() { - dir.contains(subdir_file) - } else { - // There are no tracked paths at all after `dir/` in alphabetical order, so - // there are no paths under `dir/`. - false + Some((subdir_file, _)) => dir.contains(subdir_file), + None => { + // There are no tracked paths at all after `dir/` in alphabetical order, so + // there are no paths under `dir/`. + false + } } }