mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 04:31:02 +00:00
Macros to use path instead of ident (#1474)
This commit is contained in:
@@ -33,7 +33,7 @@ mod storage_alias;
|
||||
mod transactional;
|
||||
mod tt_macro;
|
||||
|
||||
use frame_support_procedural_tools::generate_crate_access_2018;
|
||||
use frame_support_procedural_tools::generate_access_from_frame_or_crate;
|
||||
use macro_magic::{import_tokens_attr, import_tokens_attr_verbatim};
|
||||
use proc_macro::TokenStream;
|
||||
use quote::{quote, ToTokens};
|
||||
@@ -754,9 +754,9 @@ pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream
|
||||
#[import_tokens_attr_verbatim {
|
||||
format!(
|
||||
"{}::macro_magic",
|
||||
match generate_crate_access_2018("frame-support") {
|
||||
match generate_access_from_frame_or_crate("frame-support") {
|
||||
Ok(path) => Ok(path),
|
||||
Err(_) => generate_crate_access_2018("frame"),
|
||||
Err(_) => generate_access_from_frame_or_crate("frame"),
|
||||
}
|
||||
.expect("Failed to find either `frame-support` or `frame` in `Cargo.toml` dependencies.")
|
||||
.to_token_stream()
|
||||
@@ -1612,9 +1612,9 @@ pub fn pallet_section(attr: TokenStream, tokens: TokenStream) -> TokenStream {
|
||||
#[import_tokens_attr {
|
||||
format!(
|
||||
"{}::macro_magic",
|
||||
match generate_crate_access_2018("frame-support") {
|
||||
match generate_access_from_frame_or_crate("frame-support") {
|
||||
Ok(path) => Ok(path),
|
||||
Err(_) => generate_crate_access_2018("frame"),
|
||||
Err(_) => generate_access_from_frame_or_crate("frame"),
|
||||
}
|
||||
.expect("Failed to find either `frame-support` or `frame` in `Cargo.toml` dependencies.")
|
||||
.to_token_stream()
|
||||
|
||||
Reference in New Issue
Block a user