mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 01:31:33 +00:00
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:
@ -61,16 +61,20 @@ impl ProtocolsHandler for DummyProtocolsHandler {
|
|||||||
_: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output,
|
_: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output,
|
||||||
_: Self::InboundOpenInfo,
|
_: Self::InboundOpenInfo,
|
||||||
) {
|
) {
|
||||||
|
unreachable!("`DeniedUpgrade` is never successful.");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn inject_fully_negotiated_outbound(
|
fn inject_fully_negotiated_outbound(
|
||||||
&mut self,
|
&mut self,
|
||||||
_: <Self::OutboundProtocol as OutboundUpgrade<NegotiatedSubstream>>::Output,
|
_: <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) {}
|
fn inject_address_change(&mut self, _: &Multiaddr) {}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user