mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Remove some unnecessary unwraps by using the Result::ok
combinatoric
This commit is contained in:
parent
c881fc607e
commit
07202f944c
1 changed files with 2 additions and 6 deletions
|
@ -59,12 +59,8 @@ impl RootFilter {
|
||||||
if !(self.file_filter)(path) {
|
if !(self.file_filter)(path) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
if !(path.starts_with(&self.root)) {
|
let path = path.strip_prefix(&self.root).ok()?;
|
||||||
return None;
|
RelativePathBuf::from_path(path).ok()
|
||||||
}
|
|
||||||
let path = path.strip_prefix(&self.root).unwrap();
|
|
||||||
let path = RelativePathBuf::from_path(path).unwrap();
|
|
||||||
Some(path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue