Skip to content

Commit 4a3826e

Browse files
committed
refactor(config): extract toolchain variable from resolve_local_toolchain()
1 parent 8972c87 commit 4a3826e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/config.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -729,16 +729,15 @@ impl<'a> Cfg<'a> {
729729
let local = name
730730
.map(|name| name.resolve(&self.get_default_host_triple()?))
731731
.transpose()?;
732-
733-
Ok(match local {
734-
Some(tc) => Toolchain::new(self, tc)?,
735-
None => Toolchain::new(
736-
self,
732+
let toolchain = match local {
733+
Some(tc) => tc,
734+
None => {
737735
self.find_active_toolchain()?
738736
.ok_or_else(|| no_toolchain_error(self.process))?
739-
.0,
740-
)?,
741-
})
737+
.0
738+
}
739+
};
740+
Ok(Toolchain::new(self, toolchain)?)
742741
}
743742

744743
#[tracing::instrument(level = "trace", skip_all)]

0 commit comments

Comments
 (0)