chore: eliminate unwraps

This commit is contained in:
Shunsuke Shibayama 2024-03-23 09:52:52 +09:00
parent f5a21cac8a
commit d9e4dbe716
16 changed files with 65 additions and 26 deletions

View file

@ -188,7 +188,13 @@ impl ModuleCache {
}
pub fn get_similar_name(&self, name: &str) -> Option<Str> {
get_similar_name(self.cache.iter().map(|(v, _)| v.to_str().unwrap()), name).map(Str::rc)
get_similar_name(
self.cache
.iter()
.map(|(v, _)| v.to_str().unwrap_or_default()),
name,
)
.map(Str::rc)
}
pub fn rename_path(&mut self, old: &NormalizedPathBuf, new: NormalizedPathBuf) {