Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(clippy): fix all redundant_field_names
Browse files Browse the repository at this point in the history
This commit fixes all uses of `redundant_field_names` and removes the ignored lint `redundant_field_names`
  • Loading branch information
niklasad1 committed Mar 22, 2019
1 parent a269c57 commit 1c9a158
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 32 deletions.
4 changes: 2 additions & 2 deletions rpc/src/authcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl AuthCodes<DefaultTimeProvider> {
})
.collect();
Ok(AuthCodes {
codes: codes,
codes,
now: time_provider,
})
}
Expand Down Expand Up @@ -183,7 +183,7 @@ impl<T: TimeProvider> AuthCodes<T> {
.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,
});
Expand Down
1 change: 0 additions & 1 deletion rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<T> Server<T> {

Server {
server: f(remote),
event_loop: event_loop,
event_loop,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions rpc/src/tests/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/extractors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl WsStats {
/// Creates new WS usage tracker.
pub fn new(stats: Arc<RpcStats>) -> Self {
WsStats {
stats: stats,
stats,
}
}
}
Expand All @@ -210,7 +210,7 @@ impl<M: core::Middleware<Metadata>> WsDispatcher<M> {
/// Create new `WsDispatcher` with given full handler.
pub fn new(full_handler: core::MetaIoHandler<Metadata, M>) -> Self {
WsDispatcher {
full_handler: full_handler,
full_handler,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/helpers/dispatch/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/helpers/external_signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/helpers/light_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/helpers/subscription_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<S: core::Middleware<Metadata>> GenericPollManager<S> {
pub fn new(rpc: MetaIoHandler<Metadata, S>) -> Self {
GenericPollManager {
subscribers: Default::default(),
rpc: rpc,
rpc,
}
}

Expand Down
8 changes: 4 additions & 4 deletions rpc/src/v1/impls/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM, T: StateInfo + 'static> EthClient<C, SN, S
accounts: accounts.clone(),
external_miner: em.clone(),
seed_compute: Mutex::new(SeedHashCompute::default()),
options: options,
options,
deprecation_notice: Default::default(),
}
}
Expand Down Expand Up @@ -517,8 +517,8 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM, T: StateInfo + 'static> 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),
};
Expand Down Expand Up @@ -867,7 +867,7 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM, T: StateInfo + 'static> Eth for EthClient<
})
} else {
Ok(Work {
pow_hash: pow_hash,
pow_hash,
seed_hash: seed_hash.into(),
target,
number: None
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/impls/eth_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ impl<C, M> EthFilterClient<C, M> {
/// Creates new Eth filter client.
pub fn new(client: Arc<C>, miner: Arc<M>, poll_lifetime: u32) -> Self {
EthFilterClient {
client: client,
miner: miner,
client,
miner,
polls: Mutex::new(PollManager::new(poll_lifetime)),
}
}
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/impls/light/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/light/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<S: ?Sized> NetClient<S> where S: LightSyncProvider {
/// Creates new NetClient.
pub fn new(sync: Arc<S>) -> Self {
NetClient {
sync: sync,
sync,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/light/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ where
active: peer_numbers.active,
connected: peer_numbers.connected,
max: peer_numbers.max as u32,
peers: peers,
peers,
})
}

Expand Down
6 changes: 3 additions & 3 deletions rpc/src/v1/impls/light/parity_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ impl<F: Fetch> ParitySetClient<F> {
/// Creates new `ParitySetClient` with given `Fetch`.
pub fn new(client: Arc<LightChainClient>, net: Arc<ManageNetwork>, fetch: F) -> Self {
ParitySetClient {
client: client,
net: net,
fetch: fetch,
client,
net,
fetch,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl<C, M, U, S> Parity for ParityClient<C, M, U> 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,
})
}

Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
})
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/v1/impls/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl<D: Dispatcher + 'static> Signer for SignerClient<D> {
WithToken::No(_) => Err(errors::internal("Unexpected response without token.", "")),
WithToken::Yes(response, token) => Ok(ConfirmationResponseWithToken {
result: response,
token: token,
token,
}),
}))
}
Expand Down

0 comments on commit 1c9a158

Please sign in to comment.