Fix Clippy (#2522)

* Import Clippy config from Polkadot

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Auto clippy fix

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* No tabs in comments

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Prefer matches

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Dont drop references

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Trivial

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Refactor

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* add clippy to ci

* Clippy reborrow

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update client/pov-recovery/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/pov-recovery/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Partially revert 'Prefer matches'

Using matches! instead of match does give less compiler
checks as per review from @chevdor.

Partially reverts 8c0609677f3ea040f77fffd5be6facf7c3fec95c

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update .cargo/config.toml

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* Revert revert 💩

Should be fine to use matches! macro since it is an explicit whitelist,
not wildcard matching.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: alvicsam <alvicsam@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-05-06 08:01:03 +02:00
committed by GitHub
parent b72ae577a0
commit 299d25ba4b
92 changed files with 910 additions and 967 deletions
@@ -199,7 +199,7 @@ impl pallet_balances::Config for Runtime {
parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
pub const TransactionByteFee: Balance = MILLICENTS;
}
impl pallet_transaction_payment::Config for Runtime {
@@ -1038,7 +1038,7 @@ impl_runtime_apis! {
list_benchmarks!(list, extra);
let storage_info = AllPalletsWithSystem::storage_info();
return (list, storage_info)
(list, storage_info)
}
fn dispatch_benchmark(
@@ -1073,7 +1073,6 @@ impl_runtime_apis! {
id: Concrete(GeneralIndex(i as u128).into()),
fun: Fungible(fungibles_amount * i as u128),
}
.into()
})
.chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) }))
.chain((0..holding_non_fungibles).map(|i| MultiAsset {
@@ -1093,7 +1092,7 @@ impl_runtime_apis! {
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
WestendLocation::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WestendLocation::get()) },
MultiAsset { fun: Fungible(UNITS), id: Concrete(WestendLocation::get()) },
));
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
@@ -1108,7 +1107,7 @@ impl_runtime_apis! {
fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(WestendLocation::get()),
fun: Fungible(1 * UNITS),
fun: Fungible(UNITS),
}
}
}