mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
Rename PathSearch::Sibling
to PathSearch::Successor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
8f2fc079fd
commit
ec2e1c3045
1 changed files with 3 additions and 3 deletions
|
@ -323,7 +323,7 @@ impl Snapshot {
|
||||||
let new_entries = {
|
let new_entries = {
|
||||||
let mut cursor = self.entries.cursor::<_, ()>();
|
let mut cursor = self.entries.cursor::<_, ()>();
|
||||||
let mut new_entries = cursor.slice(&PathSearch::Exact(path), SeekBias::Left);
|
let mut new_entries = cursor.slice(&PathSearch::Exact(path), SeekBias::Left);
|
||||||
cursor.seek_forward(&PathSearch::Sibling(path), SeekBias::Left);
|
cursor.seek_forward(&PathSearch::Successor(path), SeekBias::Left);
|
||||||
new_entries.push_tree(cursor.suffix());
|
new_entries.push_tree(cursor.suffix());
|
||||||
new_entries
|
new_entries
|
||||||
};
|
};
|
||||||
|
@ -516,14 +516,14 @@ impl<'a> sum_tree::Dimension<'a, EntrySummary> for PathKey {
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
enum PathSearch<'a> {
|
enum PathSearch<'a> {
|
||||||
Exact(&'a Path),
|
Exact(&'a Path),
|
||||||
Sibling(&'a Path),
|
Successor(&'a Path),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Ord for PathSearch<'a> {
|
impl<'a> Ord for PathSearch<'a> {
|
||||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(Self::Exact(a), Self::Exact(b)) => a.cmp(b),
|
(Self::Exact(a), Self::Exact(b)) => a.cmp(b),
|
||||||
(Self::Sibling(a), Self::Exact(b)) => {
|
(Self::Successor(a), Self::Exact(b)) => {
|
||||||
if b.starts_with(a) {
|
if b.starts_with(a) {
|
||||||
cmp::Ordering::Greater
|
cmp::Ordering::Greater
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue