style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -221,8 +221,9 @@ fn generate_runtime_decls(decls: &[ItemTrait]) -> Result<TokenStream> {
|
||||
);
|
||||
|
||||
let err2 = match found_attributes.get(&API_VERSION_ATTRIBUTE) {
|
||||
Some(attr) =>
|
||||
Error::new(attr.span(), "Trait version is set here."),
|
||||
Some(attr) => {
|
||||
Error::new(attr.span(), "Trait version is set here.")
|
||||
},
|
||||
None => Error::new(
|
||||
decl_span,
|
||||
"Trait version is not set so it is implicitly equal to 1.",
|
||||
@@ -676,12 +677,13 @@ impl<'ast> Visit<'ast> for CheckTraitDecl {
|
||||
|
||||
fn visit_generic_param(&mut self, input: &'ast GenericParam) {
|
||||
match input {
|
||||
GenericParam::Type(ty) if ty.ident == BLOCK_GENERIC_IDENT =>
|
||||
GenericParam::Type(ty) if ty.ident == BLOCK_GENERIC_IDENT => {
|
||||
self.errors.push(Error::new(
|
||||
input.span(),
|
||||
"`Block: BlockT` generic parameter will be added automatically by the \
|
||||
`decl_runtime_apis!` macro!",
|
||||
)),
|
||||
))
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +213,10 @@ fn get_at_param_name(
|
||||
let ptype_and_borrows = param_types_and_borrows.remove(0);
|
||||
let span = ptype_and_borrows.1.span();
|
||||
if ptype_and_borrows.1 {
|
||||
return Err(Error::new(span, "`Hash` needs to be taken by value and not by reference!"));
|
||||
return Err(Error::new(
|
||||
span,
|
||||
"`Hash` needs to be taken by value and not by reference!",
|
||||
));
|
||||
}
|
||||
|
||||
let name = param_names.remove(0);
|
||||
@@ -378,7 +381,7 @@ fn generate_runtime_api_impls(impls: &[ItemImpl]) -> Result<GeneratedRuntimeApiI
|
||||
let block_type = extract_block_type_from_trait_path(impl_trait_path)?;
|
||||
|
||||
self_ty = match self_ty.take() {
|
||||
Some(self_ty) =>
|
||||
Some(self_ty) => {
|
||||
if self_ty == impl_.self_ty {
|
||||
Some(self_ty)
|
||||
} else {
|
||||
@@ -390,12 +393,13 @@ fn generate_runtime_api_impls(impls: &[ItemImpl]) -> Result<GeneratedRuntimeApiI
|
||||
error.combine(Error::new(self_ty.span(), "First self type found here"));
|
||||
|
||||
return Err(error);
|
||||
},
|
||||
}
|
||||
},
|
||||
None => Some(impl_.self_ty.clone()),
|
||||
};
|
||||
|
||||
global_block_type = match global_block_type.take() {
|
||||
Some(global_block_type) =>
|
||||
Some(global_block_type) => {
|
||||
if global_block_type == *block_type {
|
||||
Some(global_block_type)
|
||||
} else {
|
||||
@@ -410,7 +414,8 @@ fn generate_runtime_api_impls(impls: &[ItemImpl]) -> Result<GeneratedRuntimeApiI
|
||||
));
|
||||
|
||||
return Err(error);
|
||||
},
|
||||
}
|
||||
},
|
||||
None => Some(block_type.clone()),
|
||||
};
|
||||
|
||||
|
||||
@@ -146,12 +146,14 @@ pub fn extract_parameter_names_types_and_borrows(
|
||||
let name = sanitize_pattern((*arg.pat).clone(), &mut generated_pattern_counter);
|
||||
result.push((name, ty, borrow));
|
||||
},
|
||||
FnArg::Receiver(_) if matches!(allow_self, AllowSelfRefInParameters::No) =>
|
||||
return Err(Error::new(input.span(), "`self` parameter not supported!")),
|
||||
FnArg::Receiver(recv) =>
|
||||
FnArg::Receiver(_) if matches!(allow_self, AllowSelfRefInParameters::No) => {
|
||||
return Err(Error::new(input.span(), "`self` parameter not supported!"))
|
||||
},
|
||||
FnArg::Receiver(recv) => {
|
||||
if recv.mutability.is_some() || recv.reference.is_none() {
|
||||
return Err(Error::new(recv.span(), "Only `&self` is supported!"));
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +188,9 @@ pub fn extract_block_type_from_trait_path(trait_: &Path) -> Result<&TypePath> {
|
||||
let span = trait_.segments.last().as_ref().unwrap().span();
|
||||
Err(Error::new(span, "Missing `Block` generic parameter."))
|
||||
},
|
||||
PathArguments::Parenthesized(_) =>
|
||||
Err(Error::new(generics.arguments.span(), "Unexpected parentheses in path!")),
|
||||
PathArguments::Parenthesized(_) => {
|
||||
Err(Error::new(generics.arguments.span(), "Unexpected parentheses in path!"))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user