diff options
author | HampusM <hampus@hampusmat.com> | 2022-07-31 13:26:41 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-01 15:52:23 +0200 |
commit | 3383faeaf8342cf4637b6d9a9dfba30b1684edca (patch) | |
tree | 3a4e23d299d077eaf82cb09a093eaaae384e4ec2 /macros/src/injectable_impl.rs | |
parent | 8d2c6412fec2f35581a48433421db4b03a8d6657 (diff) |
feat: add hide impl of Injectable from documentation
This will make it so that by default the impl of Injectable is hidden from user code documentation. This commit also includes a flag for the injectable macro to disable the aforementioned feature
Diffstat (limited to 'macros/src/injectable_impl.rs')
-rw-r--r-- | macros/src/injectable_impl.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/macros/src/injectable_impl.rs b/macros/src/injectable_impl.rs index f510407..227a8c6 100644 --- a/macros/src/injectable_impl.rs +++ b/macros/src/injectable_impl.rs @@ -38,7 +38,7 @@ impl Parse for InjectableImpl impl InjectableImpl { - pub fn expand(&self) -> proc_macro2::TokenStream + pub fn expand(&self, no_doc_hidden: bool) -> proc_macro2::TokenStream { let Self { dependency_types, @@ -51,9 +51,18 @@ impl InjectableImpl let get_dependencies = Self::_create_get_dependencies(dependency_types); + let maybe_doc_hidden = if no_doc_hidden { + quote! {} + } else { + quote! { + #[doc(hidden)] + } + }; + quote! { #original_impl + #maybe_doc_hidden impl #generics syrette::interfaces::injectable::Injectable for #self_type { fn resolve( #di_container_var: &syrette::DIContainer |