mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Update to latest proc-macro-crate version (#8294)
This commit is contained in:
@@ -18,4 +18,4 @@ proc-macro = true
|
||||
syn = { version = "1.0.58", features = ["full", "visit"] }
|
||||
quote = "1.0"
|
||||
proc-macro2 = "1.0.6"
|
||||
proc-macro-crate = "0.1.4"
|
||||
proc-macro-crate = "1.0.0"
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro2::{TokenStream as TokenStream2, Span, Ident};
|
||||
use proc_macro_crate::crate_name;
|
||||
use proc_macro_crate::{crate_name, FoundCrate};
|
||||
use quote::quote;
|
||||
use syn::{parse::{Parse, ParseStream, Result}};
|
||||
use syn::parse::{Parse, ParseStream, Result};
|
||||
|
||||
mod assignment;
|
||||
mod codec;
|
||||
@@ -348,18 +348,13 @@ fn unique_targets_impl(count: usize) -> TokenStream2 {
|
||||
}
|
||||
|
||||
fn imports() -> Result<TokenStream2> {
|
||||
if std::env::var("CARGO_PKG_NAME").unwrap() == "sp-npos-elections" {
|
||||
Ok(quote! {
|
||||
use crate as _npos;
|
||||
})
|
||||
} else {
|
||||
match crate_name("sp-npos-elections") {
|
||||
Ok(sp_npos_elections) => {
|
||||
let ident = syn::Ident::new(&sp_npos_elections, Span::call_site());
|
||||
Ok(quote!( extern crate #ident as _npos; ))
|
||||
},
|
||||
Err(e) => Err(syn::Error::new(Span::call_site(), &e)),
|
||||
}
|
||||
match crate_name("sp-npos-elections") {
|
||||
Ok(FoundCrate::Itself) => Ok(quote! { use crate as _npos; }),
|
||||
Ok(FoundCrate::Name(sp_npos_elections)) => {
|
||||
let ident = syn::Ident::new(&sp_npos_elections, Span::call_site());
|
||||
Ok(quote!( extern crate #ident as _npos; ))
|
||||
},
|
||||
Err(e) => Err(syn::Error::new(Span::call_site(), e)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user