Skip to content

Commit

Permalink
chore: fix clippy lints (#1882)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 authored Dec 10, 2024
1 parent 6f8c5af commit f363f77
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cli/src/commands/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ fn calls_differences<'a>(
pallet_metadata_1: &'a PalletMetadata<'a>,
pallet_metadata_2: &'a PalletMetadata<'a>,
) -> Vec<Diff<&'a Variant<PortableForm>>> {
return diff(
diff(
pallet_metadata_1.call_variants().unwrap_or_default(),
pallet_metadata_2.call_variants().unwrap_or_default(),
|e| {
Expand All @@ -338,7 +338,7 @@ fn calls_differences<'a>(
.expect("call is in metadata; qed")
},
|e| &e.name,
);
)
}

fn constants_differences<'a>(
Expand Down
6 changes: 3 additions & 3 deletions core/src/storage/storage_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct StorageHashersIter<'a> {
idx: usize,
}

impl<'a> StorageHashersIter<'a> {
impl StorageHashersIter<'_> {
fn next_or_err(&mut self) -> Result<(StorageHasher, u32), Error> {
self.next().ok_or_else(|| {
StorageAddressError::TooManyKeys {
Expand All @@ -97,7 +97,7 @@ impl<'a> StorageHashersIter<'a> {
}
}

impl<'a> Iterator for StorageHashersIter<'a> {
impl Iterator for StorageHashersIter<'_> {
type Item = (StorageHasher, u32);

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -107,7 +107,7 @@ impl<'a> Iterator for StorageHashersIter<'a> {
}
}

impl<'a> ExactSizeIterator for StorageHashersIter<'a> {
impl ExactSizeIterator for StorageHashersIter<'_> {
fn len(&self) -> usize {
self.hashers.hashers_and_ty_ids.len() - self.idx
}
Expand Down
2 changes: 1 addition & 1 deletion lightclient/src/chain_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl<'a> From<&'a str> for ChainConfig<'a> {
}
}

impl<'a> From<String> for ChainConfig<'a> {
impl From<String> for ChainConfig<'_> {
fn from(chain_spec: String) -> Self {
ChainConfig::chain_spec(chain_spec)
}
Expand Down
2 changes: 1 addition & 1 deletion subxt/src/backend/chain_head/rpc_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ pub(crate) mod unsigned_number_as_string {

struct NumberVisitor<N>(std::marker::PhantomData<N>);

impl<'de, N: From<u64>> Visitor<'de> for NumberVisitor<N> {
impl<N: From<u64>> Visitor<'_> for NumberVisitor<N> {
type Value = N;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion testing/generate-custom-metadata/src/dispatch_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use scale_info::{
/// See the `ModuleErrorType` in `subxt_codegen` for more info on the different DispatchError
/// types that we've encountered. We need the path to match `sp_runtime::DispatchError`, otherwise
/// we could just implement roughly the correct types and derive TypeInfo on them.
///
/// This type has TypeInfo compatible with the `NamedField` version of the DispatchError.
/// This is the oldest version that subxt supports:
/// `DispatchError::Module { index: u8, error: u8 }`
Expand Down

0 comments on commit f363f77

Please sign in to comment.