Skip to content

Commit

Permalink
primitives/proc-macro: Generate crate access one module up
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv committed Feb 2, 2023
1 parent df770ec commit c33d3ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion primitives/api/proc-macro/src/impl_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,8 @@ fn impl_runtime_apis_impl_inner(api_impls: &[ItemImpl]) -> Result<TokenStream> {
let runtime_api_versions = generate_runtime_api_versions(api_impls)?;
let wasm_interface = generate_wasm_interface(api_impls)?;
let api_impls_for_runtime_api = generate_api_impl_for_runtime_api(api_impls)?;
let runtime_metadata = generate_runtime_metadata(api_impls)?;
let crate_ = generate_crate_access(HIDDEN_INCLUDES_ID);
let runtime_metadata = generate_runtime_metadata(api_impls, &crate_)?;

Ok(quote!(
#hidden_includes
Expand Down
4 changes: 1 addition & 3 deletions primitives/api/proc-macro/src/runtime_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fn generate_trait_metadata(impl_: &ItemImpl, crate_: &TokenStream) -> Result<Tok
}

/// Generate the runtime metadata for the given traits.
pub fn generate_runtime_metadata(impls: &[ItemImpl]) -> Result<TokenStream> {
pub fn generate_runtime_metadata(impls: &[ItemImpl], crate_: &TokenStream) -> Result<TokenStream> {
if impls.is_empty() {
return Ok(quote!())
}
Expand All @@ -191,8 +191,6 @@ pub fn generate_runtime_metadata(impls: &[ItemImpl]) -> Result<TokenStream> {

let mut metadata = Vec::new();

let crate_ = generate_crate_access(HIDDEN_INCLUDES_ID);

for impl_ in impls {
metadata.push(generate_trait_metadata(impl_, &crate_)?);
}
Expand Down

0 comments on commit c33d3ca

Please sign in to comment.