From dca4f3ede107ec343e733f580723140437cc8c7f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 25 Apr 2022 16:49:42 +0100 Subject: [PATCH] Use better syntax for doc comment attribute As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020 --- crates/arti/src/logging.rs | 4 +--- crates/tor-circmgr/src/config.rs | 4 +--- crates/tor-config/src/list_builder.rs | 10 +++------- crates/tor-dirmgr/src/authority.rs | 4 +--- crates/tor-guardmgr/src/fallback/set.rs | 12 +++++------- 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/crates/arti/src/logging.rs b/crates/arti/src/logging.rs index bef7c8090..960a5b5a4 100644 --- a/crates/arti/src/logging.rs +++ b/crates/arti/src/logging.rs @@ -66,9 +66,7 @@ impl LoggingConfig { type LogfileListConfig = Vec; define_list_config_builder! { - [ - /// List of logfiles to use, being built as part of the configuration - ] + /// List of logfiles to use, being built as part of the configuration pub struct LogfileListConfigBuilder { files: [LogfileConfigBuilder], } diff --git a/crates/tor-circmgr/src/config.rs b/crates/tor-circmgr/src/config.rs index 3add0c854..664ce56bf 100644 --- a/crates/tor-circmgr/src/config.rs +++ b/crates/tor-circmgr/src/config.rs @@ -186,9 +186,7 @@ fn default_preemptive_threshold() -> usize { type PredictedPortsList = Vec; define_list_config_builder! { - [ - /// List of preemptive ports, being built as part of the configuration - ] + /// List of preemptive ports, being built as part of the configuration pub struct PredictedPortsListBuilder { pub(crate) ports: [u16], } diff --git a/crates/tor-config/src/list_builder.rs b/crates/tor-config/src/list_builder.rs index 33688df64..600eef31c 100644 --- a/crates/tor-config/src/list_builder.rs +++ b/crates/tor-config/src/list_builder.rs @@ -35,9 +35,7 @@ /// pub struct ThingList { things: Vec } /// /// define_list_config_builder! { -/// [ -/// /// List of things, being built as part of the configuration -/// ] +/// /// List of things, being built as part of the configuration /// pub struct ThingListBuilder { /// pub(crate) things: [ThingBuilder], /// } @@ -55,9 +53,7 @@ #[macro_export] macro_rules! define_list_config_builder { { - [ - $($docs_and_attrs:tt)* - ] + $(#[ $docs_and_attrs:meta ])* pub struct $ListBuilder:ident { $field_vis:vis $things:ident : [$EntryBuilder:ty] $(,)? } @@ -65,7 +61,7 @@ macro_rules! define_list_config_builder { default = $default:expr; $( item_build: $item_build:expr; )? } => { - $($docs_and_attrs)* + $(#[ $docs_and_attrs ])* #[derive(Default, Clone, Deserialize)] #[serde(transparent)] /// diff --git a/crates/tor-dirmgr/src/authority.rs b/crates/tor-dirmgr/src/authority.rs index 78a6b32be..41b301b39 100644 --- a/crates/tor-dirmgr/src/authority.rs +++ b/crates/tor-dirmgr/src/authority.rs @@ -45,9 +45,7 @@ impl Authority { pub(crate) type AuthorityList = Vec; define_list_config_builder! { - [ - /// List of authorities, being built as part of the configuration - ] + /// List of authorities, being built as part of the configuration pub struct AuthorityListBuilder { authorities: [AuthorityBuilder], } diff --git a/crates/tor-guardmgr/src/fallback/set.rs b/crates/tor-guardmgr/src/fallback/set.rs index 8a97e8f52..c6403b684 100644 --- a/crates/tor-guardmgr/src/fallback/set.rs +++ b/crates/tor-guardmgr/src/fallback/set.rs @@ -31,13 +31,11 @@ impl> From for FallbackList { } define_list_config_builder! { - [ - /// List of fallback directories, being built as part of the configuration - /// - /// Fallback directories (represented by [`FallbackDir`]) are used by Tor - /// clients when they don't already have enough other directory information to - /// contact the network. - ] + /// List of fallback directories, being built as part of the configuration + /// + /// Fallback directories (represented by [`FallbackDir`]) are used by Tor + /// clients when they don't already have enough other directory information to + /// contact the network. pub struct FallbackListBuilder { pub(crate) fallbacks: [FallbackDirBuilder], }