Fixed panic when no toolchain was configured
@@ -344,8 +344,11 @@ impl Cfg {
}
pub fn get_default(&self) -> Result<String> {
- self.settings_file
- .with(|s| Ok(s.default_toolchain.clone().unwrap()))
+ self.settings_file.with(|s| {
+ s.default_toolchain
+ .clone()
+ .ok_or_else(|| "no default toolchain configured".into())
+ })
}
pub fn list_toolchains(&self) -> Result<Vec<String>> {
