transport/session: use try_join_all
use bytes::Bytes;
use futures::future::join_all;
+use futures::future::try_join_all;
use std::future::Future;
use std::net::SocketAddr;
use std::sync::Arc;
@@ -1166,11 +1167,8 @@ impl Session {
let connections = self.cluster.get_working_connections().await?;
let handles = connections.iter().map(|c| c.fetch_schema_version());
- let results = join_all(handles).await;
- let versions: Vec<Uuid> = results
- .iter()
- .cloned()
- .collect::<Result<Vec<_>, QueryError>>()?;
+ let versions = try_join_all(handles).await?;
+
let local_version: Uuid = versions[0];
let in_agreement = versions.into_iter().all(|v| v == local_version);
Ok(in_agreement)
