Skip to content

Commit

Permalink
don't use join_all
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandros committed Oct 22, 2024
1 parent c85007c commit fb161d9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ferrunix-core/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Registry {
/// with [`Registry::global`].
///
/// # Panics
///
/// If any of the constructors panic.
#[cfg(feature = "tokio")]
#[must_use]
pub async fn autoregistered() -> Self {
Expand All @@ -73,7 +73,16 @@ impl Registry {
});
}

set.join_all().await;
#[allow(clippy::panic)]
while let Some(res) = set.join_next().await {
match res {
Ok(_) => continue,
Err(err) if err.is_panic() => {
std::panic::resume_unwind(err.into_panic())
}
Err(err) => panic!("{err}"),
}
}

assert_eq!(
Arc::strong_count(&registry), 1,
Expand Down

0 comments on commit fb161d9

Please sign in to comment.