diff --git a/rpc/src/authcodes.rs b/rpc/src/authcodes.rs index 3a30575b82d..b348dfd729d 100644 --- a/rpc/src/authcodes.rs +++ b/rpc/src/authcodes.rs @@ -115,7 +115,7 @@ impl AuthCodes { }) .collect(); Ok(AuthCodes { - codes: codes, + codes, now: time_provider, }) } @@ -183,7 +183,7 @@ impl AuthCodes { .join("-"); trace!(target: "signer", "New authentication token generated."); self.codes.push(Code { - code: code, + code, created_at: time::Duration::from_secs(self.now.now()), last_used_at: None, }); diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 9e95f97a4b8..a537cb29424 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -21,7 +21,6 @@ #![cfg_attr( feature = "cargo-clippy", allow( - clippy::redundant_field_names, // things are often more readable this way clippy::cast_lossless, clippy::module_name_repetitions, diff --git a/rpc/src/tests/helpers.rs b/rpc/src/tests/helpers.rs index 330316d7a24..301d77e91ce 100644 --- a/rpc/src/tests/helpers.rs +++ b/rpc/src/tests/helpers.rs @@ -39,7 +39,7 @@ impl Server { Server { server: f(remote), - event_loop: event_loop, + event_loop, } } } diff --git a/rpc/src/tests/http_client.rs b/rpc/src/tests/http_client.rs index 70f0b9ed45e..0588c791e77 100644 --- a/rpc/src/tests/http_client.rs +++ b/rpc/src/tests/http_client.rs @@ -102,10 +102,10 @@ pub fn request(address: &SocketAddr, request: &str) -> Response { let body = read_block(&mut lines, true); Response { - status: status, - headers: headers, - headers_raw: headers_raw, - body: body, + status, + headers, + headers_raw, + body, } } diff --git a/rpc/src/v1/extractors.rs b/rpc/src/v1/extractors.rs index 299b7a10d63..d3384c2c1d1 100644 --- a/rpc/src/v1/extractors.rs +++ b/rpc/src/v1/extractors.rs @@ -186,7 +186,7 @@ impl WsStats { /// Creates new WS usage tracker. pub fn new(stats: Arc) -> Self { WsStats { - stats: stats, + stats, } } } @@ -210,7 +210,7 @@ impl> WsDispatcher { /// Create new `WsDispatcher` with given full handler. pub fn new(full_handler: core::MetaIoHandler) -> Self { WsDispatcher { - full_handler: full_handler, + full_handler, } } } diff --git a/rpc/src/v1/helpers/dispatch/light.rs b/rpc/src/v1/helpers/dispatch/light.rs index a2b5bc3ad91..59c3af5232f 100644 --- a/rpc/src/v1/helpers/dispatch/light.rs +++ b/rpc/src/v1/helpers/dispatch/light.rs @@ -157,7 +157,7 @@ where used_default_from: request.from.is_none(), to: request.to, nonce: request.nonce, - gas_price: gas_price, + gas_price, gas: request.gas.unwrap_or_else(|| gas_limit / 3), value: request.value.unwrap_or_default(), data: request.data.unwrap_or_else(Vec::new), diff --git a/rpc/src/v1/helpers/external_signer/mod.rs b/rpc/src/v1/helpers/external_signer/mod.rs index 49bbaafe596..0797929cbdf 100644 --- a/rpc/src/v1/helpers/external_signer/mod.rs +++ b/rpc/src/v1/helpers/external_signer/mod.rs @@ -40,7 +40,7 @@ impl SignerService { SignerService { queue: Arc::new(ConfirmationsQueue::default()), generate_new_token: Box::new(new_token), - is_enabled: is_enabled, + is_enabled, } } diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index 9e4fb524a18..3d19e3fa868 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -197,7 +197,7 @@ where Err(e) => return Either::A(future::err(e)), }; - reqs.push(request::Account { header: header_ref.clone(), address: address }.into()); + reqs.push(request::Account { header: header_ref.clone(), address }.into()); let account_idx = reqs.len() - 1; reqs.push(request::Code { header: header_ref, code_hash: Field::back_ref(account_idx, 0) }.into()); @@ -216,7 +216,7 @@ where Err(e) => return Either::A(future::err(e)), }; - reqs.push(request::Account { header: header_ref, address: address }.into()); + reqs.push(request::Account { header: header_ref, address }.into()); Either::B(self.send_requests(reqs, |mut res|match res.pop() { Some(OnDemandResponse::Account(acc)) => acc, diff --git a/rpc/src/v1/helpers/subscription_manager.rs b/rpc/src/v1/helpers/subscription_manager.rs index 4f50cad4235..d83beb397f0 100644 --- a/rpc/src/v1/helpers/subscription_manager.rs +++ b/rpc/src/v1/helpers/subscription_manager.rs @@ -52,7 +52,7 @@ impl> GenericPollManager { pub fn new(rpc: MetaIoHandler) -> Self { GenericPollManager { subscribers: Default::default(), - rpc: rpc, + rpc, } } diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 8a20b00f2f4..1b5fdf447f9 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -197,7 +197,7 @@ impl EthClient Eth for EthClient< let info = SyncInfo { starting_block: status.start_block_number.into(), - current_block: current_block, - highest_block: highest_block, + current_block, + highest_block, warp_chunks_amount: warp_chunks_amount.map(|x| U256::from(x as u64)).map(Into::into), warp_chunks_processed: warp_chunks_processed.map(|x| U256::from(x as u64)).map(Into::into), }; @@ -867,7 +867,7 @@ impl Eth for EthClient< }) } else { Ok(Work { - pow_hash: pow_hash, + pow_hash, seed_hash: seed_hash.into(), target, number: None diff --git a/rpc/src/v1/impls/eth_filter.rs b/rpc/src/v1/impls/eth_filter.rs index dd842ded0ea..c51c85fb629 100644 --- a/rpc/src/v1/impls/eth_filter.rs +++ b/rpc/src/v1/impls/eth_filter.rs @@ -68,8 +68,8 @@ impl EthFilterClient { /// Creates new Eth filter client. pub fn new(client: Arc, miner: Arc, poll_lifetime: u32) -> Self { EthFilterClient { - client: client, - miner: miner, + client, + miner, polls: Mutex::new(PollManager::new(poll_lifetime)), } } diff --git a/rpc/src/v1/impls/light/eth.rs b/rpc/src/v1/impls/light/eth.rs index fad961b7724..fa972c5d609 100644 --- a/rpc/src/v1/impls/light/eth.rs +++ b/rpc/src/v1/impls/light/eth.rs @@ -238,8 +238,8 @@ where Ok(RpcSyncStatus::Info(RpcSyncInfo { starting_block: U256::from(self.sync.start_block()), - current_block: current_block, - highest_block: highest_block, + current_block, + highest_block, warp_chunks_amount: None, warp_chunks_processed: None, })) diff --git a/rpc/src/v1/impls/light/net.rs b/rpc/src/v1/impls/light/net.rs index 3f73e010b93..a9ab012e5ad 100644 --- a/rpc/src/v1/impls/light/net.rs +++ b/rpc/src/v1/impls/light/net.rs @@ -29,7 +29,7 @@ impl NetClient where S: LightSyncProvider { /// Creates new NetClient. pub fn new(sync: Arc) -> Self { NetClient { - sync: sync, + sync, } } } diff --git a/rpc/src/v1/impls/light/parity.rs b/rpc/src/v1/impls/light/parity.rs index c0578e97ad5..5bc82cfd87b 100644 --- a/rpc/src/v1/impls/light/parity.rs +++ b/rpc/src/v1/impls/light/parity.rs @@ -140,7 +140,7 @@ where active: peer_numbers.active, connected: peer_numbers.connected, max: peer_numbers.max as u32, - peers: peers, + peers, }) } diff --git a/rpc/src/v1/impls/light/parity_set.rs b/rpc/src/v1/impls/light/parity_set.rs index f129f86b3c9..68fc212b2fb 100644 --- a/rpc/src/v1/impls/light/parity_set.rs +++ b/rpc/src/v1/impls/light/parity_set.rs @@ -43,9 +43,9 @@ impl ParitySetClient { /// Creates new `ParitySetClient` with given `Fetch`. pub fn new(client: Arc, net: Arc, fetch: F) -> Self { ParitySetClient { - client: client, - net: net, - fetch: fetch, + client, + net, + fetch, } } } diff --git a/rpc/src/v1/impls/parity.rs b/rpc/src/v1/impls/parity.rs index 4142753f3b6..51b51524201 100644 --- a/rpc/src/v1/impls/parity.rs +++ b/rpc/src/v1/impls/parity.rs @@ -152,7 +152,7 @@ impl Parity for ParityClient where active: sync_status.num_active_peers, connected: sync_status.num_peers, max: sync_status.current_max_peers(*num_peers_range.start(), *num_peers_range.end()), - peers: peers + peers, }) } diff --git a/rpc/src/v1/impls/private.rs b/rpc/src/v1/impls/private.rs index 5572c4f1c40..c3be3f91506 100644 --- a/rpc/src/v1/impls/private.rs +++ b/rpc/src/v1/impls/private.rs @@ -95,7 +95,7 @@ impl Private for PrivateClient { transaction: request, receipt: PrivateTransactionReceipt { transaction_hash: tx_hash, - contract_address: contract_address, + contract_address, status_code: 0, } }) diff --git a/rpc/src/v1/impls/rpc.rs b/rpc/src/v1/impls/rpc.rs index aa48039d40e..0c2afd57caf 100644 --- a/rpc/src/v1/impls/rpc.rs +++ b/rpc/src/v1/impls/rpc.rs @@ -32,7 +32,7 @@ impl RpcClient { let valid_apis = vec!["web3", "eth", "net", "personal", "rpc"]; RpcClient { - modules: modules, + modules, valid_apis: valid_apis.into_iter().map(ToOwned::to_owned).collect(), } } diff --git a/rpc/src/v1/impls/signer.rs b/rpc/src/v1/impls/signer.rs index 6368d0abad9..4edac1144a4 100644 --- a/rpc/src/v1/impls/signer.rs +++ b/rpc/src/v1/impls/signer.rs @@ -190,7 +190,7 @@ impl Signer for SignerClient { WithToken::No(_) => Err(errors::internal("Unexpected response without token.", "")), WithToken::Yes(response, token) => Ok(ConfirmationResponseWithToken { result: response, - token: token, + token, }), })) }