chore: fix clippy lints (#1882)

This commit is contained in:
Niklas Adolfsson
2024-12-10 13:08:40 +01:00
committed by GitHub
parent 6f8c5afa44
commit f363f77a60
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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| {
@@ -338,7 +338,7 @@ fn calls_differences<'a>(
.expect("call is in metadata; qed")
},
|e| &e.name,
);
)
}
fn constants_differences<'a>(
+3 -3
View File
@@ -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 {
@@ -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> {
@@ -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
}
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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 {
@@ -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 }`