Commit dca4f3ed authored by Ian Jackson's avatar Ian Jackson
Browse files

Use better syntax for doc comment attribute

parent 24518675
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -66,9 +66,7 @@ impl LoggingConfig {
type LogfileListConfig = Vec<LogfileConfig>;
type LogfileListConfig = Vec<LogfileConfig>;


define_list_config_builder! {
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 {
    pub struct LogfileListConfigBuilder {
        files: [LogfileConfigBuilder],
        files: [LogfileConfigBuilder],
    }
    }
+1 −3
Original line number Original line Diff line number Diff line
@@ -186,9 +186,7 @@ fn default_preemptive_threshold() -> usize {
type PredictedPortsList = Vec<u16>;
type PredictedPortsList = Vec<u16>;


define_list_config_builder! {
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 struct PredictedPortsListBuilder {
        pub(crate) ports: [u16],
        pub(crate) ports: [u16],
    }
    }
+3 −7
Original line number Original line Diff line number Diff line
@@ -35,9 +35,7 @@
/// pub struct ThingList { things: Vec<Thing> }
/// pub struct ThingList { things: Vec<Thing> }
///
///
/// define_list_config_builder! {
/// 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 struct ThingListBuilder {
///        pub(crate) things: [ThingBuilder],
///        pub(crate) things: [ThingBuilder],
///    }
///    }
@@ -55,9 +53,7 @@
#[macro_export]
#[macro_export]
macro_rules! define_list_config_builder {
macro_rules! define_list_config_builder {
    {
    {
        [
        $(#[ $docs_and_attrs:meta ])*
            $($docs_and_attrs:tt)*
        ]
        pub struct $ListBuilder:ident {
        pub struct $ListBuilder:ident {
            $field_vis:vis $things:ident : [$EntryBuilder:ty] $(,)?
            $field_vis:vis $things:ident : [$EntryBuilder:ty] $(,)?
        }
        }
@@ -65,7 +61,7 @@ macro_rules! define_list_config_builder {
        default = $default:expr;
        default = $default:expr;
        $( item_build: $item_build:expr; )?
        $( item_build: $item_build:expr; )?
    } => {
    } => {
        $($docs_and_attrs)*
        $(#[ $docs_and_attrs ])*
        #[derive(Default, Clone, Deserialize)]
        #[derive(Default, Clone, Deserialize)]
        #[serde(transparent)]
        #[serde(transparent)]
        ///
        ///
+1 −3
Original line number Original line Diff line number Diff line
@@ -45,9 +45,7 @@ impl Authority {
pub(crate) type AuthorityList = Vec<Authority>;
pub(crate) type AuthorityList = Vec<Authority>;


define_list_config_builder! {
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 {
    pub struct AuthorityListBuilder {
        authorities: [AuthorityBuilder],
        authorities: [AuthorityBuilder],
    }
    }
+5 −7
Original line number Original line Diff line number Diff line
@@ -31,13 +31,11 @@ impl<T: IntoIterator<Item = FallbackDir>> From<T> for FallbackList {
}
}


define_list_config_builder! {
define_list_config_builder! {
    [
    /// List of fallback directories, being built as part of the configuration
    /// List of fallback directories, being built as part of the configuration
    ///
    ///
    /// Fallback directories (represented by [`FallbackDir`]) are used by Tor
    /// Fallback directories (represented by [`FallbackDir`]) are used by Tor
    /// clients when they don't already have enough other directory information to
    /// clients when they don't already have enough other directory information to
    /// contact the network.
    /// contact the network.
    ]
    pub struct FallbackListBuilder {
    pub struct FallbackListBuilder {
        pub(crate) fallbacks: [FallbackDirBuilder],
        pub(crate) fallbacks: [FallbackDirBuilder],
    }
    }