-
Notifications
You must be signed in to change notification settings - Fork 193
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
Added clippy
to CI and fixed all clippy
warnings
#613
Conversation
@levkk This PR is ready for review. I had to go through several hoops to figure out one change (suggested by |
@@ -777,8 +770,8 @@ impl<'de> serde::Deserialize<'de> for DefaultShard { | |||
D: Deserializer<'de>, | |||
{ | |||
let s = String::deserialize(deserializer)?; | |||
if s.starts_with("shard_") { | |||
let shard = s[6..].parse::<usize>().map_err(serde::de::Error::custom)?; | |||
if let Some(s) = s.strip_prefix("shard_") { |
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.
Way better. I wonder how clippy figured this out, pretty impressive.
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.
Sweet!
It's a good practice to follow the Rust idioms, and using
clippy
and make sure to have no unintentionalclippy
warning is a healthy check forpgcat
. This PR addsclippy
to CI and also fixes all the existingclippy
warnings.