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

Add clippy to CI and fix several clippy warnings #625

Merged
merged 7 commits into from Jul 8, 2021

Conversation

chevdor
Copy link
Contributor

@chevdor chevdor commented Apr 19, 2021

This PR add running clippy right after rustfmt during the CI.
It also fixes many warnings (many being due to mix of spaces and tabs in the doc examples).

Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

Awesome thanks! Few tiny things to address and it's imho ready to merge.

derive/src/rpc_trait.rs Outdated Show resolved Hide resolved
derive/src/to_delegate.rs Outdated Show resolved Hide resolved
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.

TIL that if let Err(_) = thing is less good than if thing.is_err().

@@ -71,7 +71,7 @@ impl RpcMethodAttribute {
fn parse_meta(attr: &syn::Attribute, output: &syn::ReturnType) -> Option<Result<RpcMethodAttribute>> {
match attr.parse_meta().and_then(validate_attribute_meta) {
Ok(ref meta) => {
let attr_kind = match path_to_str(meta.path()).as_ref().map(String::as_str) {
let attr_kind = match path_to_str(meta.path()).as_deref() {
Copy link
Member

Choose a reason for hiding this comment

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

that's neat TIL

};
if ident.to_string() == "Self" {
let syn::PathSegment { ident, .. } = &segments[0];
let ident = ident;
Copy link
Member

@niklasad1 niklasad1 Apr 22, 2021

Choose a reason for hiding this comment

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

why this additional let binding?

@chevdor chevdor merged commit 68511bc into paritytech:master Jul 8, 2021
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.

None yet

4 participants