From fbbb45e88f067ff9f6c7c6b5dd9f5b41d202da7e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 05:20:26 +0100 Subject: links calls scheme_of --- src/swarm/links.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/swarm/links.rs') diff --git a/src/swarm/links.rs b/src/swarm/links.rs index 435a953..18b2bdd 100644 --- a/src/swarm/links.rs +++ b/src/swarm/links.rs @@ -25,6 +25,7 @@ use tracing::debug; use crate::locks::MutexExt; use crate::state::AppState; use crate::swarm::{members, topology}; +use crate::transport::paths; use crate::transport::{ Connection, Destination, Link, LinksReply, LinksRequest, OtherPath, ParsedMessage, }; @@ -132,9 +133,12 @@ pub(crate) async fn own_links(state: &AppState) -> Vec { links } -/// The scheme of `address` (`mycelium:…`): its transport. +/// The scheme of `address` (`mycelium:…`): its transport (`paths::scheme_of`), if it +/// has one. fn scheme_of(address: &str) -> Option { - address.split_once(':').map(|(scheme, _)| scheme.to_owned()) + Some(paths::scheme_of(address)) + .filter(|scheme| !scheme.is_empty()) + .map(str::to_owned) } /// The transports besides `used` the peer proved itself at, with a path up: each with -- cgit v1.3.1