From f91c4ce73786a69e4ec72f69ef4d9d5f03ac5886 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 28 Aug 2022 13:24:39 +0200 Subject: style: add rustfmt config options --- macros/src/lib.rs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'macros/src/lib.rs') diff --git a/macros/src/lib.rs b/macros/src/lib.rs index c7157c8..6e3fc0a 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -29,7 +29,8 @@ use libs::intertrait_macros::gen_caster::generate_caster; /// * (Zero or more) Flags wrapped in curly braces. Like `{ a = true, b = false }` /// /// # Flags -/// - `no_doc_hidden` - Don't hide the impl of the [`Injectable`] trait from documentation. +/// - `no_doc_hidden` - Don't hide the impl of the [`Injectable`] trait from +/// documentation. /// /// # Panics /// If the attributed item is not a impl. @@ -68,14 +69,15 @@ use libs::intertrait_macros::gen_caster::generate_caster; /// impl Knight /// { /// pub fn new( -/// #[named("tough")] -/// tough_armor: TransientPtr, +/// #[named("tough")] tough_armor: TransientPtr, /// -/// #[named("light")] -/// light_armor: TransientPtr +/// #[named("light")] light_armor: TransientPtr, /// ) -> Self /// { -/// Self { tough_armor, light_armor } +/// Self { +/// tough_armor, +/// light_armor, +/// } /// } /// } /// # @@ -145,8 +147,8 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt /// ``` /// use std::collections::HashMap; /// -/// use syrette::interfaces::factory::IFactory; /// use syrette::factory; +/// use syrette::interfaces::factory::IFactory; /// /// enum ConfigValue /// { @@ -161,7 +163,8 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt /// fn configure(&self, key: String, value: ConfigValue); /// } /// -/// struct Configurator { +/// struct Configurator +/// { /// config: HashMap, /// } /// @@ -171,11 +174,10 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt /// { /// Self { /// config: HashMap::from( -/// keys -/// .iter() +/// keys.iter() /// .map(|key| (key.clone(), ConfigValue::None)) -/// .collect::>() -/// ) +/// .collect::>(), +/// ), /// } /// } /// } @@ -226,7 +228,6 @@ pub fn factory(_: TokenStream, type_alias_stream: TokenStream) -> TokenStream /// /// # Arguments /// {Implementation} -> {Interface} -/// #[proc_macro] pub fn declare_interface(input: TokenStream) -> TokenStream { @@ -265,11 +266,9 @@ pub fn declare_interface(input: TokenStream) -> TokenStream /// impl Ninja /// { /// pub fn new( -/// #[syrette::named("strong")] -/// strong_weapon: TransientPtr, +/// #[syrette::named("strong")] strong_weapon: TransientPtr, /// -/// #[syrette::named("weak")] -/// weak_weapon: TransientPtr, +/// #[syrette::named("weak")] weak_weapon: TransientPtr, /// ) -> Self /// { /// Self { -- cgit v1.2.3-18-g5258