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 | 20b0be670d3798d63ccf36d0fb014c64e7b729b7 (patch) | |
| tree | 5abff705a545933f84c9d34a89c234e2eda96a4d /src/swarm | |
| parent | 44b4288f52f0b205c308483c61037f1427f1b1ad (diff) | |
links calls scheme_of
Diffstat (limited to 'src/swarm')
| -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 |
