-
Notifications
You must be signed in to change notification settings - Fork 279
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
Fix clippy warnings for new stable rust 1.50.0
#282
Conversation
d0ff5f7
to
3bf20b9
Compare
1.50.0
d2f22cd
to
3ebf720
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be changed as well to IntoWalletDescriptor
.
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 yes makes sense. Fixed.
CHANGELOG.md
Outdated
@@ -27,6 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
### 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` | |||
|
|||
### Policy |
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 line has trailing whitespace.
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.
👍 fixed.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the trait should be renamed also to IntoWalletDescriptor
.
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.
Yes good call, fixed.
CHANGELOG.md
Outdated
@@ -27,6 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
### 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should mention ToDescriptorKey
as well?
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.
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
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.
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
stable
version of rust1.50.0
.The first clippy warning
unnecessary_wraps
only 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_convention
which requires renaming theToWalletDescriptor::to_wallet_descriptor()
function tointo_wallet_descriptor()
to satisfy the naming convention thatinto_
methods takeself
andto_
methods take&self
.Notes to the reviewers
Once this is merged to
master
I'll cherry pick it to the `release/0.4.0' branch.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: