chore: fix clippy lints for rope2, sum_tree, text2 and util

This commit is contained in:
Piotr Osiewicz 2024-01-01 23:50:14 +01:00
parent 219999cd8d
commit 4fa28b3de2
6 changed files with 10 additions and 12 deletions

View file

@ -67,8 +67,8 @@ impl<T: AsRef<Path>> PathExt for T {
fn icon_suffix(&self) -> Option<&str> {
let file_name = self.as_ref().file_name()?.to_str()?;
if file_name.starts_with(".") {
return file_name.strip_prefix(".");
if file_name.starts_with('.') {
return file_name.strip_prefix('.');
}
self.as_ref()
@ -213,7 +213,7 @@ impl Eq for PathMatcher {}
impl PathMatcher {
pub fn new(maybe_glob: &str) -> Result<Self, globset::Error> {
Ok(PathMatcher {
glob: Glob::new(&maybe_glob)?.compile_matcher(),
glob: Glob::new(maybe_glob)?.compile_matcher(),
maybe_path: PathBuf::from(maybe_glob),
})
}