mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 17:19:37 +00:00
working_copy: switch an if let Some() { } else { }
to a match
This commit is contained in:
parent
0fbb1d3971
commit
78da5596b7
1 changed files with 7 additions and 6 deletions
|
@ -387,16 +387,17 @@ impl TreeState {
|
||||||
// optimize it to check exactly the already-tracked files (we know that
|
// optimize it to check exactly the already-tracked files (we know that
|
||||||
// we won't have to consider new files in the directory).
|
// we won't have to consider new files in the directory).
|
||||||
let first_file_in_dir = dir.join(&RepoPathComponent::from("\0"));
|
let first_file_in_dir = dir.join(&RepoPathComponent::from("\0"));
|
||||||
if let Some((subdir_file, _)) = self
|
match self
|
||||||
.file_states
|
.file_states
|
||||||
.range((Bound::Included(&first_file_in_dir), Bound::Unbounded))
|
.range((Bound::Included(&first_file_in_dir), Bound::Unbounded))
|
||||||
.next()
|
.next()
|
||||||
{
|
{
|
||||||
dir.contains(subdir_file)
|
Some((subdir_file, _)) => dir.contains(subdir_file),
|
||||||
} else {
|
None => {
|
||||||
// There are no tracked paths at all after `dir/` in alphabetical order, so
|
// There are no tracked paths at all after `dir/` in alphabetical order, so
|
||||||
// there are no paths under `dir/`.
|
// there are no paths under `dir/`.
|
||||||
false
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue