fixup poor utility naming
This commit is contained in:
parent
36f3d3d738
commit
cdc6566d87
1 changed files with 9 additions and 8 deletions
|
@ -159,9 +159,14 @@ pub async fn match_path_sets<'a, Set: PathMatchCandidateSet<'a>>(
|
||||||
positions: Vec::new(),
|
positions: Vec::new(),
|
||||||
path: candidate.path.clone(),
|
path: candidate.path.clone(),
|
||||||
path_prefix: candidate_set.prefix(),
|
path_prefix: candidate_set.prefix(),
|
||||||
distance_to_relative_ancestor: distance_to_relative_ancestor(
|
distance_to_relative_ancestor: relative_to.as_ref().map_or(
|
||||||
candidate.path.as_ref(),
|
usize::MAX,
|
||||||
&relative_to,
|
|relative_to| {
|
||||||
|
distance_between_paths(
|
||||||
|
candidate.path.as_ref(),
|
||||||
|
relative_to.as_ref(),
|
||||||
|
)
|
||||||
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -189,11 +194,7 @@ pub async fn match_path_sets<'a, Set: PathMatchCandidateSet<'a>>(
|
||||||
|
|
||||||
/// Compute the distance from a given path to some other path
|
/// Compute the distance from a given path to some other path
|
||||||
/// If there is no shared path, returns usize::MAX
|
/// If there is no shared path, returns usize::MAX
|
||||||
fn distance_to_relative_ancestor(path: &Path, relative_to: &Option<Arc<Path>>) -> usize {
|
fn distance_between_paths(path: &Path, relative_to: &Path) -> usize {
|
||||||
let Some(relative_to) = relative_to else {
|
|
||||||
return usize::MAX;
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut path_components = path.components();
|
let mut path_components = path.components();
|
||||||
let mut relative_components = relative_to.components();
|
let mut relative_components = relative_to.components();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue