Skip to content

Fix clippy lints for rlp-derive#345

Merged
ordian merged 1 commit into
paritytech:masterfrom
vorot93:rlp-derive-clippy
Feb 21, 2020
Merged

Fix clippy lints for rlp-derive#345
ordian merged 1 commit into
paritytech:masterfrom
vorot93:rlp-derive-clippy

Conversation

@vorot93
Copy link
Copy Markdown
Contributor

@vorot93 vorot93 commented Feb 13, 2020

No description provided.

@parity-cla-bot
Copy link
Copy Markdown

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

Many thanks,

Parity Technologies CLA Bot

Copy link
Copy Markdown
Contributor

@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.

Comment thread rlp-derive/tests/rlp.rs

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

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

Comment thread rlp-derive/tests/rlp.rs
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

dvdplm commented Feb 14, 2020

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

@niklasad1
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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