You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we use the proc_macro_crate to find the Sylvia crate. This way the generated code can work even if an alias was used for the dependency.
pub(crate)fncrate_module() -> Path{use proc_macro_crate::{crate_name,FoundCrate};matchcrate_name("sylvia").expect("sylvia is not found in Cargo.toml"){FoundCrate::Itself => parse_quote!(sylvia),FoundCrate::Name(name) => {let ident = syn::Ident::new(&name, proc_macro2::Span::mixed_site());parse_quote!(#ident)}}}
If however in the future a need for providing custom path to the Sylvia crate would occur we could consider adding serde-like functionality:
Currently we use the proc_macro_crate to find the Sylvia crate. This way the generated code can work even if an alias was used for the dependency.
If however in the future a need for providing custom path to the Sylvia crate would occur we could consider adding serde-like functionality:
This was also discussed here https://users.rust-lang.org/t/how-to-express-crate-path-in-procedural-macros/91274/17.
The text was updated successfully, but these errors were encountered: