From 9dfc54ebabd4cf771579f46109a704d3837eb056 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Aug 2021 22:50:39 +0100 Subject: [PATCH] config: get global config, macro doc Signed-off-by: Ian Jackson --- macros/macros.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/macros/macros.rs b/macros/macros.rs index ee79e07..6413499 100644 --- a/macros/macros.rs +++ b/macros/macros.rs @@ -46,8 +46,13 @@ use itertools::Itertools; /// } /// } /// -/// pub struct InstanceConfigCommon { -/// { +/// pub struct InstanceConfigCommon { ... } +/// impl InstanceConfigCommon { +/// pub fn from(l: &[InstanceConfig]) { InstanceConfigCommon { +/// field: ::resolve(l.iter().map(|e| &e.field)), +/// ... +/// } } +/// } /// ``` #[proc_macro_derive(ResolveConfig, attributes( limited, server, client, computed, special, -- 2.30.2