From bff42bf27f58bacb8bce58458dea7da74cda2c05 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 15:24:41 +0100 Subject: allow dead Connection unless a transport needs it --- src/transport/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/transport/mod.rs') diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 40fdfc0..b10c799 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -382,9 +382,13 @@ pub(crate) struct Punching { /// How a transport with connections (libp2p) is connected to a peer. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] +// Only libp2p and Tor have connections; without both (the cargo features) nothing makes +// one. +#[cfg_attr(not(any(feature = "libp2p", feature = "tor")), allow(dead_code))] pub(crate) enum Connection { + /// libp2p's to the peer itself; Tor's always (an onion circuit). Direct, - /// Only through a relay. + /// Only through a relay (libp2p). Relayed, } -- cgit v1.3.1