Skip to content

Commit 5647a9e

Browse files
committed
feat(config)!: add verbose flag to ensure_installed()
1 parent 9ef85bc commit 5647a9e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/config.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ impl<'a> Cfg<'a> {
752752
profile,
753753
} => {
754754
let toolchain = self
755-
.ensure_installed(toolchain, components, targets, profile)
755+
.ensure_installed(toolchain, components, targets, profile, false)
756756
.await?
757757
.1;
758758
Ok((toolchain, reason))
@@ -768,7 +768,7 @@ impl<'a> Cfg<'a> {
768768
Some(ToolchainName::Official(toolchain_desc)) => {
769769
let reason = ActiveReason::Default;
770770
let toolchain = self
771-
.ensure_installed(toolchain_desc, vec![], vec![], None)
771+
.ensure_installed(toolchain_desc, vec![], vec![], None, false)
772772
.await?
773773
.1;
774774
Ok((toolchain, reason))
@@ -786,7 +786,11 @@ impl<'a> Cfg<'a> {
786786
components: Vec<String>,
787787
targets: Vec<String>,
788788
profile: Option<Profile>,
789+
verbose: bool,
789790
) -> Result<(UpdateStatus, Toolchain<'_>)> {
791+
if verbose {
792+
(self.notify_handler)(Notification::LookingForToolchain(&toolchain));
793+
}
790794
let components: Vec<_> = components.iter().map(AsRef::as_ref).collect();
791795
let targets: Vec<_> = targets.iter().map(AsRef::as_ref).collect();
792796
let profile = match profile {
@@ -806,6 +810,9 @@ impl<'a> Cfg<'a> {
806810
.await?
807811
}
808812
Ok(mut distributable) => {
813+
if verbose {
814+
(self.notify_handler)(Notification::UsingExistingToolchain(&toolchain));
815+
}
809816
let status = if !distributable.components_exist(&components, &targets)? {
810817
distributable.update(&components, &targets, profile).await?
811818
} else {

0 commit comments

Comments
 (0)