pub fn generate_hidden_includes(unique_id: &'static str) -> TokenStream {
	if env::var("CARGO_PKG_NAME").unwrap() == "substrate-client" {
		TokenStream::new()
	} else {
		let mod_name = generate_hidden_includes_mod_name(unique_id);
		match crate_name("substrate-client") {
			Ok(client_name) => {
				let client_name = Ident::new(&client_name, Span::call_site());
				quote!(
					#[doc(hidden)]
					mod #mod_name {
						pub extern crate #client_name as sr_api_client;
					}
				)
			},
			Err(e) => {
				let err = Error::new(Span::call_site(), &e).to_compile_error();
				quote!( #err )
			}
		}

	}.into()
}
/// Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope .
pub fn generate_hidden_includes(unique_id: &'static str) -> TokenStream {
	if env::var("CARGO_PKG_NAME").unwrap() == "substrate-client" {
		TokenStream::new()
	} else {
		let mod_name = generate_hidden_includes_mod_name(unique_id);
		match crate_name("substrate-client") {
			Ok(client_name) => {
				let client_name = Ident::new(&client_name, Span::call_site());
				quote!(
					#[doc(hidden)]
					mod #mod_name {
						pub extern crate #client_name as sr_api_client;
					}
				)
			},
			Err(e) => {
				let err = Error::new(Span::call_site(), &e).to_compile_error();
				quote!( #err )
			}
		}
	}.into()
}
pub fn generate_hidden_includes ( unique_id : & ' static str ) -> TokenStream { if env :: var ( " " ) . unwrap ( ) == " " { TokenStream :: new ( ) } else { let mod_name = generate_hidden_includes_mod_name ( unique_id ) ; match crate_name ( " " ) { Ok ( client_name ) => { let client_name = Ident :: new ( & client_name , Span :: call_site ( ) ) ; quote ! ( [ doc ( hidden ) ] mod mod_name { pub extern crate client_name as sr_api_client } ) } , Err ( e ) => { let err = Error :: new ( Span :: call_site ( ) , & e ) . to_compile_error ( ) ; quote ! ( err ) } } } . into ( ) }
Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope .
unique_id
&'static str
unique_id
&'static str