Skip to content

Commit dc83fed

Browse files
committed
Take owned LocalToolchainName in Toolchain::from_local()
1 parent af20d03 commit dc83fed

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cli/proxy_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub async fn main(arg0: &str, current_dir: PathBuf, process: &Process) -> Result
4040

4141
let toolchain = match toolchain {
4242
None => cfg.find_or_install_active_toolchain().await?.0,
43-
Some(tc) => Toolchain::from_local(&tc, false, &cfg).await?,
43+
Some(tc) => Toolchain::from_local(tc, false, &cfg).await?,
4444
};
4545

4646
let cmd = toolchain.command(arg0)?;

src/cli/rustup_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ async fn run(
907907
install: bool,
908908
) -> Result<ExitStatus> {
909909
let toolchain = toolchain.resolve(&cfg.get_default_host_triple()?)?;
910-
let toolchain = Toolchain::from_local(&toolchain, install, cfg).await?;
910+
let toolchain = Toolchain::from_local(toolchain, install, cfg).await?;
911911
let cmd = toolchain.command(&command[0])?;
912912
command::run_command_for_dir(cmd, &command[0], &command[1..])
913913
}

src/toolchain/toolchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ pub(crate) struct Toolchain<'a> {
3939

4040
impl<'a> Toolchain<'a> {
4141
pub(crate) async fn from_local(
42-
toolchain_name: &LocalToolchainName,
42+
name: LocalToolchainName,
4343
install_if_missing: bool,
4444
cfg: &'a Cfg<'a>,
4545
) -> anyhow::Result<Toolchain<'a>> {
46-
match Self::new(cfg, toolchain_name.clone()) {
46+
match Self::new(cfg, name) {
4747
Ok(tc) => Ok(tc),
4848
Err(RustupError::ToolchainNotInstalled(ToolchainName::Official(desc)))
4949
if install_if_missing =>

0 commit comments

Comments
 (0)