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

fix(rpc): fix a bunch of clippy lints #10493

Merged
merged 4 commits into from
Mar 22, 2019
Merged

fix(rpc): fix a bunch of clippy lints #10493

merged 4 commits into from
Mar 22, 2019

Conversation

niklasad1
Copy link
Collaborator

@niklasad1 niklasad1 commented Mar 20, 2019

Attempt to cleanup the rpc crate after #10217 was merged which has a lot of needless into()

I have ignored a bunch of lints which I think is just annoying which can be found in rpc/lib.rs. I can revert that change if anyone doesn't agree.

Furthermore, I have fixed most clippy::all lints with ~15 exceptions!

rpc/src/v1/impls/light/parity.rs Outdated Show resolved Hide resolved
rpc/src/v1/impls/light/parity.rs Outdated Show resolved Hide resolved
rpc/src/lib.rs Outdated Show resolved Hide resolved
rpc/src/lib.rs Outdated Show resolved Hide resolved
@ordian ordian added this to the 2.5 milestone Mar 20, 2019
@ordian ordian added the M4-core ⛓ Core client code / Rust. label Mar 20, 2019
rpc/src/v1/impls/eth.rs Outdated Show resolved Hide resolved
rpc/src/v1/impls/eth.rs Outdated Show resolved Hide resolved
@soc1c soc1c added the A0-pleasereview 🤓 Pull request needs code review. label Mar 20, 2019
This commit fixes all uses of `redundant_field_names` and removes the ignored lint `redundant_field_names`
@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 22, 2019
@@ -135,7 +135,7 @@ impl<T: Default + Copy + Ord> StatsCalculator<T> {
#[derive(Default, Debug)]
pub struct RpcStats {
requests: RwLock<RateCalculator>,
roundtrips: RwLock<StatsCalculator<u32>>,
roundtrips: RwLock<StatsCalculator<u128>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Clippy lint does this change correspond to?

Copy link
Collaborator Author

@niklasad1 niklasad1 Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question it was this one https://rust-lang.github.io/rust-clippy/master/#duration_subsec

But I replaced our own as_micros() method with Duration::as_micros and don't truncate the result as u32

@HCastano HCastano merged commit 17042e9 into master Mar 22, 2019
@HCastano HCastano deleted the rpc-clippy branch March 22, 2019 11:01
ordian added a commit that referenced this pull request Apr 5, 2019
* master: (48 commits)
  ethcore: remove eth social and easthub chain configs (#10531)
  Initial support sccache for windows build (#10520)
  fix(light): make `OnDemand` generic instead of using the concrete type (#10514)
  private-tx: replace error_chain (#10510)
  Add trace information to eth_estimateGas (#10519)
  ethcore: add clique engine (#9981)
  verbose flag for cpp tests (#10524)
  Add a more realistic Batch test (#10511)
  docs: add changelogs for 2.3.{6,7,8} and 2.4.{1,2,3} (#10494)
  fix(rpc): fix a bunch of clippy lints (#10493)
  fix Sha3/keccak256 hash calculation for binaries (#10509)
  Add additional request tests (#10503)
  whisper/cli: add p2p port and ip parameters (#10057)
  fix(time-utils): add missing license (#10497)
  fix(extract `timestamp_checked_add` as lib) (#10383)
  fix(rpc): lint `unused_extern_crates` + fix warns (#10489)
  fix win&mac build (#10486)
  Сaching through docker volume (#10477)
  OpenBlock::new take IntoIterator instead of mutable ref to Iterator (#10480)
  simplify block module and usage (#10479)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants