Fix warnings: dyn

This commit is contained in:
adria0
2020-07-29 10:36:15 +02:00
committed by Artem Vorotnikov
parent 4adb44155d
commit 1700873f48
198 changed files with 1180 additions and 1072 deletions

View File

@@ -76,16 +76,16 @@ impl TestProtocol {
}
impl NetworkProtocolHandler for TestProtocol {
fn initialize(&self, io: &NetworkContext) {
fn initialize(&self, io: &dyn NetworkContext) {
io.register_timer(0, Duration::from_millis(10)).unwrap();
}
fn read(&self, _io: &NetworkContext, _peer: &PeerId, packet_id: u8, data: &[u8]) {
fn read(&self, _io: &dyn NetworkContext, _peer: &PeerId, packet_id: u8, data: &[u8]) {
assert_eq!(packet_id, 33);
self.packet.lock().extend(data);
}
fn connected(&self, io: &NetworkContext, peer: &PeerId) {
fn connected(&self, io: &dyn NetworkContext, peer: &PeerId) {
assert!(io.peer_client_version(*peer).to_string().contains("Parity"));
if self.drop_session {
io.disconnect_peer(*peer)
@@ -94,12 +94,12 @@ impl NetworkProtocolHandler for TestProtocol {
}
}
fn disconnected(&self, _io: &NetworkContext, _peer: &PeerId) {
fn disconnected(&self, _io: &dyn NetworkContext, _peer: &PeerId) {
self.got_disconnect.store(true, AtomicOrdering::Relaxed);
}
/// Timer function called after a timeout created with `NetworkContext::timeout`.
fn timeout(&self, _io: &NetworkContext, timer: TimerToken) {
fn timeout(&self, _io: &dyn NetworkContext, timer: TimerToken) {
assert_eq!(timer, 0);
self.got_timeout.store(true, AtomicOrdering::Relaxed);
}