Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy lints for rlp-derive #345

Merged
merged 1 commit into from
Feb 21, 2020
Merged

Fix clippy lints for rlp-derive #345

merged 1 commit into from
Feb 21, 2020

Conversation

vorot93
Copy link
Contributor

@vorot93 vorot93 commented Feb 13, 2020

No description provided.

@parity-cla-bot
Copy link

It looks like @vorot93 signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Not sure I can say this is an improvement, but sure, why not.

@@ -10,62 +10,62 @@ use rlp::{decode, encode};
use rlp_derive::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper};

#[derive(Debug, PartialEq, RlpEncodable, RlpDecodable)]
struct Foo {
struct Item {
Copy link
Member

Choose a reason for hiding this comment

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

lol, I didn't know it this lint existed https://rust-lang.github.io/rust-clippy/current/index.html#blacklisted_name
Not sure how useful it is though

let attack_of = String::from("clones");
let foo = Foo { a: attack_of.clone() };
let attack_of = "clones";
let item = Item { a: attack_of.into() };
Copy link
Member

Choose a reason for hiding this comment

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

it was a pun on attack of clones :(

Copy link
Contributor

Choose a reason for hiding this comment

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

Clippy has exactly zero sense of humour.

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

I don't think this is much of an improvement either but sure why not.

@dvdplm
Copy link
Contributor

dvdplm commented Feb 14, 2020

Can someone point me to the lint ihat replaces match with if let … else?

@niklasad1
Copy link
Member

niklasad1 commented Feb 14, 2020

Can someone point me to the lint ihat replaces match with if let … else?

https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else

I'm not a fan of this lint because it is more personal style preference, should be whitelisted IMHO.

@dvdplm
Copy link
Contributor

dvdplm commented Feb 14, 2020

I'm not a fan of this lint because it is more personal style preference, should be whitelisted IMHO.

I for one much prefer the match. (link is https://rust-lang.github.io/rust-clippy/master/#single_match_else btw, you click the paragraph-symbol, the backwards facing "P" thingy).

@vorot93 do you mind whitelisting this one and revert those changes?

@vorot93
Copy link
Contributor Author

vorot93 commented Feb 14, 2020

I can whitelist but I do think that if let else both reads much more naturally and reduces right shift.

@ordian
Copy link
Member

ordian commented Feb 21, 2020

Let's obey clippy.

@ordian ordian merged commit 3ca30bf into paritytech:master Feb 21, 2020
@vorot93 vorot93 deleted the rlp-derive-clippy branch February 21, 2020 20:56
ordian added a commit that referenced this pull request Mar 2, 2020
* master:
  kvdb-rocksdb: bump version (#348)
  kvdb-rocksdb: expose RocksDB stats (#347)
  Implement Error for FromDecStrErr (#346)
  Fix clippy lints for rlp-derive (#345)
ordian added a commit that referenced this pull request Mar 6, 2020
* master:
  kvdb-rocksdb: bump version (#348)
  kvdb-rocksdb: expose RocksDB stats (#347)
  Implement Error for FromDecStrErr (#346)
  Fix clippy lints for rlp-derive (#345)
  prepare rlp-derive release (#344)
  Update/change licenses: MIT/Apache2.0 (#342)
  rlp-derive extracted (#343)
  Format for readme and changelog corrected (#341)
  Parity runtime moved to parity common for publication in crates.io (#271)
  Disable cache if explicit memory budget=0 passed (#339)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants