diff options
Diffstat (limited to 'src/swarm/links.rs')
| -rw-r--r-- | src/swarm/links.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/swarm/links.rs b/src/swarm/links.rs index 5938986..fa05e72 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<Link> { 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<String> { - 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 |
