mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Use Result instead of panicking when the resource dir can't be found
This commit is contained in:
parent
20b1764d71
commit
ceb85795b1
11 changed files with 81 additions and 64 deletions
|
@ -17,7 +17,7 @@ pub fn resolve_chrome_url(url: &Url) -> Result<Url, ()> {
|
|||
if url.host_str() != Some("resources") {
|
||||
return Err(())
|
||||
}
|
||||
let resources = canonicalize(resources_dir_path())
|
||||
let resources = canonicalize(resources_dir_path().expect("Error finding resource folder"))
|
||||
.expect("Error canonicalizing path to the resources directory");
|
||||
let mut path = resources.clone();
|
||||
for segment in url.path_segments().unwrap() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue