swarm/src/protocols_handler/dummy: Make use of void::Void (#2407)

Use `void::unreachable!` to verify `DummyProtocolsHandler` behavior at compile time.
This commit is contained in:
Max Inden
2021-12-30 11:10:13 +01:00
committed by GitHub
parent df2e5a591e
commit 4b5283643d

View File

@ -61,16 +61,20 @@ impl ProtocolsHandler for DummyProtocolsHandler {
_: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output,
_: Self::InboundOpenInfo,
) {
unreachable!("`DeniedUpgrade` is never successful.");
}
fn inject_fully_negotiated_outbound(
&mut self,
_: <Self::OutboundProtocol as OutboundUpgrade<NegotiatedSubstream>>::Output,
_: Self::OutboundOpenInfo,
v: Self::OutboundOpenInfo,
) {
void::unreachable(v)
}
fn inject_event(&mut self, _: Self::InEvent) {}
fn inject_event(&mut self, v: Self::InEvent) {
void::unreachable(v)
}
fn inject_address_change(&mut self, _: &Multiaddr) {}