mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 15:11:02 +00:00
Improve spans of pallet macro (#7830)
* fix spans * convert name to snake case
This commit is contained in:
committed by
GitHub
parent
d2ac8bd941
commit
66a9093fa3
@@ -26,10 +26,16 @@ pub struct HooksDef {
|
||||
pub instances: Vec<helper::InstanceUsage>,
|
||||
/// The where_clause used.
|
||||
pub where_clause: Option<syn::WhereClause>,
|
||||
/// The span of the pallet::hooks attribute.
|
||||
pub attr_span: proc_macro2::Span,
|
||||
}
|
||||
|
||||
impl HooksDef {
|
||||
pub fn try_from(index: usize, item: &mut syn::Item) -> syn::Result<Self> {
|
||||
pub fn try_from(
|
||||
attr_span: proc_macro2::Span,
|
||||
index: usize,
|
||||
item: &mut syn::Item,
|
||||
) -> syn::Result<Self> {
|
||||
let item = if let syn::Item::Impl(item) = item {
|
||||
item
|
||||
} else {
|
||||
@@ -61,6 +67,7 @@ impl HooksDef {
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
attr_span,
|
||||
index,
|
||||
instances,
|
||||
where_clause: item.generics.where_clause.clone(),
|
||||
|
||||
Reference in New Issue
Block a user