Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhry committed Jan 8, 2025
1 parent 543444c commit 185b4b9
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ use syn::{
parse_macro_input, parse_quote,
spanned::Spanned,
visit_mut::{self, VisitMut},
Attribute, Ident, ImplItem, ItemImpl, ItemMod, ItemUse, Path, Signature, Type, TypePath,
UseTree,
Attribute, Ident, ImplItem, ItemImpl, ItemMod, Path, Signature, Type, TypePath, UseTree,
};

use std::collections::HashMap;
Expand Down Expand Up @@ -867,24 +866,6 @@ pub fn impl_runtime_apis_impl(input: proc_macro::TokenStream) -> proc_macro::Tok
.into()
}

fn parse_path(path: &mut Vec<Ident>, item: &UseTree) -> Result<()> {
match &item {
syn::UseTree::Path(use_path) => {
path.push(use_path.ident.clone());
parse_path(path, use_path.tree.as_ref())
},
syn::UseTree::Glob(_) => Ok(()),
syn::UseTree::Name(_) | syn::UseTree::Rename(_) | syn::UseTree::Group(_) => {
let error = Error::new(
item.span(),
"Unsupported syntax used to import api implementaions from an extension module. \
Try using `pub use <path>::*` or `use <path>::*`",
);
return Err(error)
},
}
}

fn impl_runtime_apis_impl_inner(
api_impls: &mut [ItemImpl],
uses: &[TypePath],
Expand Down

0 comments on commit 185b4b9

Please sign in to comment.