swarm/: Provide additional default impls on NetworkBehaviour (#2150)

Not all implementations of `NetworkBehaviour` need all callbacks.
We've have been adding new callbacks with default implementations
for a while now. There is no reason the initial ones cannot also
be defaulted, thus making it easier create new implementations.

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Thomas Eizinger
2021-07-31 03:48:32 +10:00
committed by GitHub
parent 76f1fcbee3
commit ad90167042
10 changed files with 29 additions and 71 deletions

View File

@ -82,12 +82,6 @@ where
self.addresses.get(p).map_or(Vec::new(), |v| v.clone())
}
fn inject_connected(&mut self, _: &PeerId) {
}
fn inject_disconnected(&mut self, _: &PeerId) {
}
fn inject_event(&mut self, _: PeerId, _: ConnectionId, _: THandler::OutEvent) {
}