-
Notifications
You must be signed in to change notification settings - Fork 29
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
Clean up some clippy warnings #277
Conversation
There is one "real" change here which is that the visit_byte_buf method was previously dead code because the "alloc" feature was not defined (and the crate depends unconditionally on std). Instead of deleting the method I removed the conditional so that the method will be included.
@@ -39,7 +39,7 @@ fn validate_input(input: Vec<EnvelopeData>) -> Result<LogState> { | |||
let key = signing::PrivateKey::decode(e_data.key.clone()).unwrap(); | |||
let mut record: operator::OperatorRecord = e_data.contents.try_into().unwrap(); | |||
|
|||
record.prev = last.clone(); | |||
record.prev.clone_from(last); |
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.
I was surprised that clippy would recommend a readability regression like this and it looks like I am not alone: rust-lang/rust-clippy#12778
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.
Want to disable the lint rather than make this change?
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.
eh, given its just in tests its probably fine to leave this PR as-is.
@@ -91,6 +91,7 @@ pub struct NewCheckpoint<'a> { | |||
|
|||
#[derive(Queryable)] | |||
#[diesel(table_name = checkpoints)] | |||
#[allow(dead_code)] |
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.
What was marked dead here? I'm surprised anything in a #[derive(Queryable)]
would be...
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.
The timestamp fields. The query fills them in, but nothing reads them.
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.
Ah yeah I guess Queryable
would be read-only wouldn't it? 👍
Thanks! |
Remove some unused imports, use
clone_from
where appropriate, allow unread fields on a Postgres-related structure, and fix a#[cfg(feature = ...)]
referencing a non-existent feature.