-
Notifications
You must be signed in to change notification settings - Fork 143
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
Clippy lints MSRV 1.56.1 #640
Clippy lints MSRV 1.56.1 #640
Conversation
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.
Thanks for doing these man, appreciated - and the linter found a bug in the tests, linting for the WIN.
ACK bb29ecc
src/psbt/mod.rs
Outdated
} | ||
|
||
fn lookup_sha256(&self, h: &Pk::Sha256) -> Option<Preimage32> { | ||
self.psbt.inputs[self.index] | ||
.sha256_preimages | ||
.get(&Pk::to_sha256(h)) | ||
.and_then(try_vec_as_preimage32) | ||
.and_then(|x: &std::vec::Vec<u8>| try_vec_as_preimage32(x)) |
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.
This won't work in no-std builds, just use plain old Vec
, its imported already in this file using use prelude::*
.
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.
Done, this seems obvious now in retrospect...
for (i, c) in (b'A'..b'Z').enumerate() { | ||
for (i, c) in (b'A'..=b'Z').enumerate() { |
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.
This changes the behaviour of the loop to now include 'Z', from looking at the code it looks like this was a bug and the change is correct but this change warranted a patch on its own with a comment on the bug. Since its test code, I think we can leave it as is now though.
BTW I've got deja vu reviewing this, I've definitely removed these lint warnings before somewhere. I can't remember where but I remember hitting this 'Z' thing especially.
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.
Yeah, I remember this too. #523 It was even mixed in with CI crap.
Woops I acked, but needs the Vec change. CI should catch that though. |
@storopoli ok, I merged your other two PRs. Can you rebase this one and get CI working? |
Nothing out of the ordinary. The most alarming was the non-inclusive range in `test_utils.rs`. In some test functions I allowed myself to use `#[allow(clippy::type_complexity)]` because clippy was asking to create a type instead of using the big tuple. Since these were used just once, I thought it was overkill. Note, depends on: - #639 (we can also merge this into it instead of `master`) - #638 (has some allows on dead_code)
Hooray! |
Lol @ the Thanks very much for fixing CI. Funny how every clippy update finds a new category of "unnecessary |
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.
ACK e2636f3
Probably a simple Tuple Struct
Yes, clippy lints are truly amazing. Never stops to impress me... |
Nothing out of the ordinary.
The most alarming was the non-inclusive range in
test_utils.rs
.In some test functions I allowed myself to use
#[allow(clippy::type_complexity)]
because clippy was asking to create a type instead of using the big tuple. Since these were used just once, I thought it was overkill.Note, depends on:
master
)max_satisfaction_weight
#638 (has some allows on dead_code)