working_copy: switch an if let Some() { } else { } to a match

This commit is contained in:
Martin von Zweigbergk 2022-04-26 20:59:07 -07:00 committed by Martin von Zweigbergk
parent 0fbb1d3971
commit 78da5596b7

View File

@ -387,18 +387,19 @@ 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 {
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
}
}
}
fn update_file_state(
&mut self,