Skip to content

Commit 348102e

Browse files
committed
config: simplify update_all_channels()
1 parent f736345 commit 348102e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/config.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::str::FromStr;
66
use anyhow::{Context, Result, anyhow, bail};
77
use serde::Deserialize;
88
use thiserror::Error as ThisError;
9-
use tokio_stream::StreamExt;
109
use tracing::{debug, error, info, trace, warn};
1110

1211
use crate::dist::AutoInstallMode;
@@ -897,22 +896,23 @@ impl<'a> Cfg<'a> {
897896
&self,
898897
force_update: bool,
899898
) -> Result<Vec<(ToolchainDesc, Result<UpdateStatus>)>> {
900-
let channels = self.list_channels()?;
901-
let channels = channels.into_iter();
902899
let profile = self.get_profile()?;
903900

904901
// Update toolchains and collect the results
905-
let channels = tokio_stream::iter(channels).then(|(desc, mut distributable)| async move {
906-
let st = distributable
902+
let mut channels = Vec::new();
903+
for (desc, mut distributable) in self.list_channels()? {
904+
let result = distributable
907905
.update_extra(&[], &[], profile, force_update, false)
908906
.await;
909-
if let Err(e) = &st {
907+
908+
if let Err(e) = &result {
910909
error!("{e}");
911910
}
912-
(desc, st)
913-
});
914911

915-
Ok(channels.collect().await)
912+
channels.push((desc, result));
913+
}
914+
915+
Ok(channels)
916916
}
917917

918918
pub(crate) fn set_default_host_triple(&self, host_triple: String) -> Result<()> {

0 commit comments

Comments
 (0)