mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -195,7 +195,7 @@ fn init_user_prefs(path: &mut PathBuf) {
|
|||
}
|
||||
|
||||
fn read_prefs() -> Result<HashMap<String, Pref>, ()> {
|
||||
let mut path = resources_dir_path();
|
||||
let mut path = try!(resources_dir_path().map_err(|_| ()));
|
||||
path.push("prefs.json");
|
||||
|
||||
let file = try!(File::open(path).or_else(|e| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue