diff options
| author | tv <tv@krebsco.de> | 2026-10-31 05:20:26 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 05:20:26 +0100 |
| commit | fbbb45e88f067ff9f6c7c6b5dd9f5b41d202da7e (patch) | |
| tree | 939581a2b26a06e829597b3900b60d97b95e3fb0 /src/swarm/links.rs | |
| parent | 224a2fc3cea4b638a9699ea28fefb000a39d1314 (diff) | |
links calls scheme_of
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 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<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 |
