-
Notifications
You must be signed in to change notification settings - Fork 273
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
Conversation
2b33a12
to
201989a
Compare
There was a problem hiding this 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.
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
?
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).