Skip to content

Commit aceb09b

Browse files
committed
cli: inline Cfg::resolve_local_toolchain()
1 parent 2846189 commit aceb09b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/cli/proxy_mode.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ pub async fn main(arg0: &str, current_dir: PathBuf, process: &Process) -> Result
3434
.collect();
3535

3636
let cfg = Cfg::from_env(current_dir, true, process)?;
37-
let toolchain = cfg.resolve_local_toolchain(toolchain).await?;
37+
let toolchain = cfg
38+
.local_toolchain(match toolchain {
39+
Some(name) => Some(name.resolve(&cfg.get_default_host_triple()?)?),
40+
None => None,
41+
})
42+
.await?;
43+
3844
let mut cmd = toolchain.command(arg0)?;
3945
if toolchain_specified {
4046
cmd.env(

src/config.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -706,16 +706,6 @@ impl<'a> Cfg<'a> {
706706
Ok(Some(Toolchain::new(self, name)?.rustc_version()))
707707
}
708708

709-
pub(crate) async fn resolve_local_toolchain(
710-
&self,
711-
name: Option<ResolvableLocalToolchainName>,
712-
) -> Result<Toolchain<'_>> {
713-
let local = name
714-
.map(|name| name.resolve(&self.get_default_host_triple()?))
715-
.transpose()?;
716-
self.local_toolchain(local).await
717-
}
718-
719709
pub(crate) async fn local_toolchain(
720710
&self,
721711
name: Option<LocalToolchainName>,

0 commit comments

Comments
 (0)