mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
sp-api: Move macro related re-exports to __private (#2446)
This moves the macro related re-exports to `__private` to make it more obvious for downstream users that they are using an internal api. --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -28,14 +28,14 @@ use syn::{
|
||||
/// Generates the access to the `sc_client` crate.
|
||||
pub fn generate_crate_access() -> TokenStream {
|
||||
match crate_name("sp-api") {
|
||||
Ok(FoundCrate::Itself) => quote!(sp_api),
|
||||
Ok(FoundCrate::Itself) => quote!(sp_api::__private),
|
||||
Ok(FoundCrate::Name(renamed_name)) => {
|
||||
let renamed_name = Ident::new(&renamed_name, Span::call_site());
|
||||
quote!(#renamed_name)
|
||||
quote!(#renamed_name::__private)
|
||||
},
|
||||
Err(e) =>
|
||||
if let Ok(FoundCrate::Name(name)) = crate_name(&"frame") {
|
||||
let path = format!("{}::deps::{}", name, "sp_api");
|
||||
let path = format!("{}::deps::sp_api::__private", name);
|
||||
let path = syn::parse_str::<syn::Path>(&path).expect("is a valid path; qed");
|
||||
quote!( #path )
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user