Skip to content

Commit c4c7674

Browse files
committed
Reduce indirection in Cfg::from_partial()
1 parent 87216b8 commit c4c7674

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,13 @@ impl<'a> Cfg<'a> {
494494
&self,
495495
toolchain: Option<PartialToolchainDesc>,
496496
) -> anyhow::Result<Toolchain<'_>> {
497-
match toolchain.map(|it| ResolvableToolchainName::from(&it)) {
497+
match toolchain {
498498
Some(toolchain) => {
499499
let desc = toolchain.resolve(&self.get_default_host_triple()?)?;
500-
Ok(Toolchain::new(self, desc.into())?)
500+
Ok(Toolchain::new(
501+
self,
502+
LocalToolchainName::Named(ToolchainName::Official(desc)),
503+
)?)
501504
}
502505
None => Ok(self.find_or_install_active_toolchain().await?.0),
503506
}

0 commit comments

Comments
 (0)