Allow the main ruma crate to re-export the ruma-api-macro things
This commit is contained in:
parent
6877c2f38d
commit
98ddf25ae2
@ -28,9 +28,12 @@ pub fn strip_serde_attrs(field: &Field) -> Field {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn import_ruma_api() -> TokenStream {
|
pub fn import_ruma_api() -> TokenStream {
|
||||||
if let Ok(name) = crate_name("ruma-api") {
|
if let Ok(possibly_renamed) = crate_name("ruma-api") {
|
||||||
let import = Ident::new(&name, Span::call_site());
|
let import = Ident::new(&possibly_renamed, Span::call_site());
|
||||||
quote! { ::#import }
|
quote! { ::#import }
|
||||||
|
} else if let Ok(possibly_renamed) = crate_name("ruma") {
|
||||||
|
let import = Ident::new(&possibly_renamed, Span::call_site());
|
||||||
|
quote! { ::#import::api }
|
||||||
} else {
|
} else {
|
||||||
quote! { ::ruma_api }
|
quote! { ::ruma_api }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user