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 |
danielabrozzoni
left a comment
There was a problem hiding this comment.
Overall it looks really good, thanks a lot!
A few questions/suggestions:
|
rebasing now. dropped all the changes to |
There was a problem hiding this comment.
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. |
LLFourn
left a comment
There was a problem hiding this comment.
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`
evanlinjin
left a comment
There was a problem hiding this comment.
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 |
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
Boxing 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 fmtandcargo clippybefore committing