Safely index modes

This commit is contained in:
Luke
2020-06-11 20:53:02 +12:00
parent bf3588e516
commit 7e9c78605b
14 changed files with 328 additions and 15 deletions

View File

@@ -37,8 +37,8 @@ impl Config {
.unwrap_or_else(|_| panic!("Could not deserialise {}", CONFIG_PATH));
self = c;
} else {
self =
toml::from_str(&buf).expect(&format!("Could not deserialise {}", CONFIG_PATH));
self = toml::from_str(&buf)
.unwrap_or_else(|_| panic!("Could not deserialise {}", CONFIG_PATH));
}
}
self