From 02d4820f7c93393d983f12fe157f5b77da317bcd Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 3 Aug 2023 21:16:42 +0200 Subject: docs: move the injectable macro example section --- macros/src/lib.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'macros/src/lib.rs') diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 5f5b0b6..18fe3c6 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -79,6 +79,22 @@ const PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION"); /// You can however also use the concrete type as the interface. As it is declared as such /// by default if the `no_declare_concrete_interface` flag is not set. /// +/// # Examples +/// ``` +/// # use syrette::injectable; +/// # +/// # struct PasswordManager {} +/// # +/// #[injectable] +/// impl PasswordManager +/// { +/// pub fn new() -> Self +/// { +/// Self {} +/// } +/// } +/// ``` +/// /// # Attributes /// Attributes specific to impls with this attribute macro. /// @@ -122,22 +138,6 @@ const PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION"); /// # impl IKnight for Knight {} /// ``` /// -/// # Example -/// ``` -/// # use syrette::injectable; -/// # -/// # struct PasswordManager {} -/// # -/// #[injectable] -/// impl PasswordManager -/// { -/// pub fn new() -> Self -/// { -/// Self {} -/// } -/// } -/// ``` -/// /// [`DIContainer`]: https://docs.rs/syrette/latest/syrette/di_container/struct.DIContainer.html /// [`AsyncDIContainer`]: https://docs.rs/syrette/latest/syrette/async_di_container/struct.AsyncDIContainer.html /// [`Injectable`]: https://docs.rs/syrette/latest/syrette/interfaces/injectable/trait.Injectable.html -- cgit v1.2.3-18-g5258