mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
chore: eliminate unwrap
s
This commit is contained in:
parent
f5a21cac8a
commit
d9e4dbe716
16 changed files with 65 additions and 26 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue