-
Notifications
You must be signed in to change notification settings - Fork 312
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 clippy allows #1186
Clean up clippy allows #1186
Conversation
The first attempt failed CI due to After taking another look at spk_iter.rs, I think it's fine to allow the exception (as it was originally), since we're specifically testing |
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.
Overall it looks really good, thanks a lot!
A few questions/suggestions:
rebasing now. dropped all the changes to |
crates/bdk/src/wallet/mod.rs
Outdated
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 guess I'm on the fence regarding preselect_utxos
. @LLFourn would you prefer we left this untouched so it's clear at the call site exactly what information we're passing?
Reminder to bump msrv in clippy.toml
|
Changes in most recent push:
|
Please revert all changes to the tmp plan crate and just blanket allow everything. Other than that this looks good to go. |
@LLFourn appreciate your input, thanks for clarifying. |
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 c4f1211
Thanks @ValuedMammal!
Is anyone opposed to making the type /// The initial state returned from [`init`].
pub struct Init<CS: clap::Subcommand, S: clap::Args, C> {
/// Arguments parsed by the cli.
pub args: Args<CS, S>,
/// Descriptor keymap.
pub keymap: KeyMap,
/// Keychain-txout index.
pub index: KeychainTxOutIndex<Keychain>,
/// Persistence backend.
pub db: Mutex<Database<C>>,
/// Initial changeset.
pub init_changeset: C,
} |
@ValuedMammal go for it! |
These lints either resolved themselves, or the code has changed such that they no longer apply, hence they can be removed with no further changes. `clippy::derivable_impls` `clippy::needless_collect` `clippy::almost_swapped`
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.
Looking good! Just a couple of NITs
- Add typedefs to model the result of functions `planned_utxos` and `init` - Add new struct `CreateTxChange` to hold any change info resulting from `create_tx` These changes help resolve clippy::type_complexity
to reduce the number of required function args in order to satisfy `clippy::too_many_arguments`
to address `clippy::result_large_err`. Clippy's default large-error- threshold is 128. `esplora_client::Error` currently has size 272.
for holding the items returned from `example_cli::init`
Thank you to all the reviewers! @danielabrozzoni @LLFourn |
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 1c15cb2
closes #1127
There are several instances in the code where we allow clippy lints that would otherwise be flagged during regular checks. It would be preferable to minimize the number of "clippy allow" attributes either by fixing the affected areas or setting a specific configuration in
clippy.toml
. In cases where we have to allow a particular lint, it should be documented why the lint doesn't apply.For context see #1127 (comment) as well as the commit message details.
One area I'm unsure of is whether
Box
ing a large error in 4fc2216 is the right approach. Logically it makes sense to avoid allocating a needlessly heavyResult
, but I haven't studied the implications or tradeoffs of such a change.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing