Skip to content
Snippets Groups Projects
Commit dca4f3ed authored by Ian Jackson's avatar Ian Jackson
Browse files

Use better syntax for doc comment attribute

parent 24518675
No related branches found
No related tags found
1 merge request!471Introduce macro for ThingListBuilder, and use for AuthorityListBuilder
......@@ -66,9 +66,7 @@ impl LoggingConfig {
type LogfileListConfig = Vec<LogfileConfig>;
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],
}
......
......@@ -186,9 +186,7 @@ fn default_preemptive_threshold() -> usize {
type PredictedPortsList = Vec<u16>;
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],
}
......
......@@ -35,9 +35,7 @@
/// pub struct ThingList { things: Vec<Thing> }
///
/// 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)]
///
......
......@@ -45,9 +45,7 @@ impl Authority {
pub(crate) type AuthorityList = Vec<Authority>;
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],
}
......
......@@ -31,13 +31,11 @@ impl<T: IntoIterator<Item = FallbackDir>> From<T> 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],
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment