Fix fuzzy matching after removing root dirname from stored paths

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-04-23 15:22:47 -07:00
co-authored by Nathan Sobo
parent dced9469f5
commit 054203d21c
4 changed files with 139 additions and 68 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Default)]
pub struct CharBag(u64);
impl CharBag {
@@ -23,6 +23,14 @@ impl CharBag {
}
}
impl Extend<char> for CharBag {
fn extend<T: IntoIterator<Item = char>>(&mut self, iter: T) {
for c in iter {
self.insert(c);
}
}
}
impl From<&str> for CharBag {
fn from(s: &str) -> Self {
let mut bag = Self(0);