diff --git a/CHANGELOG.md b/CHANGELOG.md index fd47858..f1cd13b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# Unreleased + +## Changed + +- Update suggestion when no default toolchain is configured (#31) +- Fix `elan show` when no default toolchain is configured (#33) + # 1.0.3 - 2021-04-30 ## Changed diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index b8d27a2..faf300a 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -340,7 +340,7 @@ fn show(cfg: &Cfg) -> Result<()> { if show_headers { print_header("installed toolchains") } let default_name = try!(cfg.get_default()); for t in installed_toolchains { - if default_name == t { + if default_name.as_ref() == Some(&t) { println!("{} (default)", t); } else { println!("{}", t); diff --git a/src/elan/config.rs b/src/elan/config.rs index 9e76698..1476777 100644 --- a/src/elan/config.rs +++ b/src/elan/config.rs @@ -271,9 +271,9 @@ impl Cfg { }) } - pub fn get_default(&self) -> Result { + pub fn get_default(&self) -> Result> { self.settings_file.with(|s| { - Ok(s.default_toolchain.clone().unwrap()) + Ok(s.default_toolchain.clone()) }) }