Fix clippy warnings for new stable rust 1.50.0#282
Fix clippy warnings for new stable rust 1.50.0#282afilini merged 6 commits intobitcoindevkit:masterfrom
1.50.0#282Conversation
d0ff5f7 to
3bf20b9
Compare
1.50.0
d2f22cd to
3ebf720
Compare
tcharding
left a comment
There was a problem hiding this comment.
Typo in brief message of commit: 25222b4 Fix clippy warning 'unnecissary_wraps' (unnecessary misspelled).
Thanks
src/descriptor/mod.rs
Outdated
| @@ -74,15 +74,15 @@ pub type HDKeyPaths = BTreeMap<PublicKey, KeySource>; | |||
| /// Trait for types which can be converted into an [`ExtendedDescriptor`] and a [`KeyMap`] usable by a wallet in a specific [`Network`] | |||
| pub trait ToWalletDescriptor { | |||
There was a problem hiding this comment.
Perhaps this should be changed as well to IntoWalletDescriptor.
There was a problem hiding this comment.
Ah yes makes sense. Fixed.
CHANGELOG.md
Outdated
| - Removed the explicit `id` argument from `Wallet::add_signer()` since that's now part of `Signer` itself | ||
| - Renamed `ToWalletDescriptor::to_wallet_descriptor` to `ToWalletDescriptor::into_wallet_descriptor` | ||
|
|
||
| ### Policy |
There was a problem hiding this comment.
This line has trailing whitespace.
src/descriptor/template.rs
Outdated
| @@ -70,12 +70,12 @@ pub trait DescriptorTemplate { | |||
| /// Turns a [`DescriptorTemplate`] into a valid wallet descriptor by calling its | |||
| /// [`build`](DescriptorTemplate::build) method | |||
| impl<T: DescriptorTemplate> ToWalletDescriptor for T { | |||
There was a problem hiding this comment.
Perhaps the trait should be renamed also to IntoWalletDescriptor.
There was a problem hiding this comment.
Yes good call, fixed.
CHANGELOG.md
Outdated
| ### Wallet | ||
| #### Changed | ||
| - Removed the explicit `id` argument from `Wallet::add_signer()` since that's now part of `Signer` itself | ||
| - Renamed `ToWalletDescriptor::to_wallet_descriptor` to `ToWalletDescriptor::into_wallet_descriptor` |
There was a problem hiding this comment.
Perhaps we should mention ToDescriptorKey as well?
There was a problem hiding this comment.
Yes just added and I also renamed the trait ToDescriptorKey to be IntoDescriptorKey to match the into_descriptor_key() function name.
3ebf720 to
8827e32
Compare
48adfd9 to
1c6864a
Compare
afilini
left a comment
There was a problem hiding this comment.
utACK 1c6864a
I'm a bit annoyed by this thing that our CI breaks every time there's a new Rust release.. maybe we should consider hard-coding the toolchain version and only manually update it "atomically" in a PR that fixes all the new clippy warnings that come with it.
|
Merging those into the release branch as well since we'll need the CI to run the tests before publishing |
Ya I agree. I'll create a PR 🙂 |
Alternatively we can just keep the code linting cleanly using nightly (assuming no breaking changes to previous stable versions) and then this issue shouldn't arise. This PR makes a start. |
|
I think trying to keep our code mostly or partially in sync with nightly lint rules will be more work than it's worth. I'd rather do what @afilini is suggesting above which is to hard code our CI to test against our MSRV |
Description
Two new clippy warning are showing up with the new
stableversion of rust1.50.0.The first clippy warning
unnecessary_wrapsonly required removing the unnecessary Result wrapper for thepolicy::finalize()andcompact_filters peer::_recv()functions.Slightly more changes were required for the second warning
wrong_self_conventionwhich requires renaming theToWalletDescriptor::to_wallet_descriptor()function tointo_wallet_descriptor()to satisfy the naming convention thatinto_methods takeselfandto_methods take&self.Notes to the reviewers
Once this is merged to
masterI'll cherry pick it to the `release/0.4.0' branch.Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.mdBugfixes: