diff options
Diffstat (limited to 'globset/src/lib.rs')
-rw-r--r-- | globset/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/globset/src/lib.rs b/globset/src/lib.rs index 6b3ca85c..0b3b7b6c 100644 --- a/globset/src/lib.rs +++ b/globset/src/lib.rs @@ -119,7 +119,7 @@ use std::path::Path; use std::str; use aho_corasick::AhoCorasick; -use bstr::{B, BStr, BString}; +use bstr::{B, ByteSlice, ByteVec}; use regex::bytes::{Regex, RegexBuilder, RegexSet}; use pathutil::{file_name, file_name_ext, normalize_path}; @@ -490,15 +490,15 @@ impl GlobSetBuilder { /// path against multiple globs or sets of globs. #[derive(Clone, Debug)] pub struct Candidate<'a> { - path: Cow<'a, BStr>, - basename: Cow<'a, BStr>, - ext: Cow<'a, BStr>, + path: Cow<'a, [u8]>, + basename: Cow<'a, [u8]>, + ext: Cow<'a, [u8]>, } impl<'a> Candidate<'a> { /// Create a new candidate for matching from the given path. pub fn new<P: AsRef<Path> + ?Sized>(path: &'a P) -> Candidate<'a> { - let path = normalize_path(BString::from_path_lossy(path.as_ref())); + let path = normalize_path(Vec::from_path_lossy(path.as_ref())); let basename = file_name(&path).unwrap_or(Cow::Borrowed(B(""))); let ext = file_name_ext(&basename).unwrap_or(Cow::Borrowed(B(""))); Candidate { @@ -508,7 +508,7 @@ impl<'a> Candidate<'a> { } } - fn path_prefix(&self, max: usize) -> &BStr { + fn path_prefix(&self, max: usize) -> &[u8] { if self.path.len() <= max { &*self.path } else { @@ -516,7 +516,7 @@ impl<'a> Candidate<'a> { } } - fn path_suffix(&self, max: usize) -> &BStr { + fn path_suffix(&self, max: usize) -> &[u8] { if self.path.len() <= max { &*self.path } else { |