Run cargo fix on a few of the worst offenders (#10854)

* Run cargo fix on `vm`

* Run cargo fix on ethcore-db

* Run cargo fix on evm

* Run cargo fix on ethcore-light

* Run cargo fix on journaldb

* Run cargo fix on wasm

* Missing docs

* Run cargo fix on ethcore-sync
This commit is contained in:
David
2019-07-09 10:04:20 +02:00
committed by Seun LanLege
parent fdc7b0fdaa
commit f53c3e582c
46 changed files with 369 additions and 368 deletions

View File

@@ -120,7 +120,7 @@ impl AncestorSearch {
}
}
fn process_response<L>(self, ctx: &ResponseContext, client: &L) -> AncestorSearch
fn process_response<L>(self, ctx: &dyn ResponseContext, client: &L) -> AncestorSearch
where L: AsLightClient
{
let client = client.as_light_client();
@@ -258,7 +258,7 @@ impl Deref for SyncStateWrapper {
struct ResponseCtx<'a> {
peer: PeerId,
req_id: ReqId,
ctx: &'a BasicContext,
ctx: &'a dyn BasicContext,
data: &'a [encoded::Header],
}
@@ -292,7 +292,7 @@ struct PendingReq {
impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {
fn on_connect(
&self,
ctx: &EventContext,
ctx: &dyn EventContext,
status: &Status,
capabilities: &Capabilities
) -> PeerStatus {
@@ -319,7 +319,7 @@ impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {
}
}
fn on_disconnect(&self, ctx: &EventContext, unfulfilled: &[ReqId]) {
fn on_disconnect(&self, ctx: &dyn EventContext, unfulfilled: &[ReqId]) {
let peer_id = ctx.peer();
let peer = match self.peers.write().remove(&peer_id).map(|p| p.into_inner()) {
@@ -370,7 +370,7 @@ impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {
self.maintain_sync(ctx.as_basic());
}
fn on_announcement(&self, ctx: &EventContext, announcement: &Announcement) {
fn on_announcement(&self, ctx: &dyn EventContext, announcement: &Announcement) {
let (last_td, chain_info) = {
let peers = self.peers.read();
match peers.get(&ctx.peer()) {
@@ -406,7 +406,7 @@ impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {
self.maintain_sync(ctx.as_basic());
}
fn on_responses(&self, ctx: &EventContext, req_id: ReqId, responses: &[request::Response]) {
fn on_responses(&self, ctx: &dyn EventContext, req_id: ReqId, responses: &[request::Response]) {
let peer = ctx.peer();
if !self.peers.read().contains_key(&peer) {
return
@@ -448,7 +448,7 @@ impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {
self.maintain_sync(ctx.as_basic());
}
fn tick(&self, ctx: &BasicContext) {
fn tick(&self, ctx: &dyn BasicContext) {
self.maintain_sync(ctx);
}
}
@@ -492,7 +492,7 @@ impl<L: AsLightClient> LightSync<L> {
}
// handles request dispatch, block import, state machine transitions, and timeouts.
fn maintain_sync(&self, ctx: &BasicContext) {
fn maintain_sync(&self, ctx: &dyn BasicContext) {
use ethcore::error::{Error as EthcoreError, ImportError};
const DRAIN_AMOUNT: usize = 128;