Loading crates/tor-netdoc/src/types/family.rs +2 −8 Original line number Diff line number Diff line Loading @@ -19,13 +19,13 @@ use tor_llcrypto::pk::rsa::RsaIdentity; /// entries, including entries that are only nicknames. /// /// TODO: This type probably belongs in a different crate. #[derive(Clone, Debug)] #[derive(Clone, Debug, Default)] pub struct RelayFamily(Vec<RsaIdentity>); impl RelayFamily { /// Return a new empty RelayFamily. pub fn new() -> Self { RelayFamily(Vec::new()) RelayFamily::default() } /// Does this family include the given relay? Loading @@ -40,12 +40,6 @@ impl RelayFamily { } } impl Default for RelayFamily { fn default() -> Self { RelayFamily::new() } } impl std::str::FromStr for RelayFamily { type Err = Error; fn from_str(s: &str) -> Result<Self> { Loading crates/tor-netdoc/src/types/policy/addrpolicy.rs +3 −9 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ use super::{PolicyError, PortRange}; /// accept *:9000-65535 /// reject *:* /// ``` #[derive(Clone, Debug)] #[derive(Clone, Debug, Default)] pub struct AddrPolicy { /// A list of rules to apply to find out whether an address is /// contained by this policy. Loading Loading @@ -74,14 +74,14 @@ impl AddrPolicy { /// Create a new AddrPolicy that matches nothing. pub fn new() -> Self { AddrPolicy { rules: Vec::new() } AddrPolicy::default() } /// Add a new rule to this policy. /// /// The newly added rule is applied _after_ all previous rules. /// It matches all addresses and ports covered by AddrPortPattern. /// ///nn /// If accept is true, the rule is to accept addresses that match; /// if accept is false, the rule rejects such addresses. pub fn push(&mut self, kind: RuleKind, pattern: AddrPortPattern) { Loading @@ -89,12 +89,6 @@ impl AddrPolicy { } } impl Default for AddrPolicy { fn default() -> Self { AddrPolicy::new() } } /// A single rule in an address policy. /// /// Contains a pattern and what to do with things that match it. Loading Loading
crates/tor-netdoc/src/types/family.rs +2 −8 Original line number Diff line number Diff line Loading @@ -19,13 +19,13 @@ use tor_llcrypto::pk::rsa::RsaIdentity; /// entries, including entries that are only nicknames. /// /// TODO: This type probably belongs in a different crate. #[derive(Clone, Debug)] #[derive(Clone, Debug, Default)] pub struct RelayFamily(Vec<RsaIdentity>); impl RelayFamily { /// Return a new empty RelayFamily. pub fn new() -> Self { RelayFamily(Vec::new()) RelayFamily::default() } /// Does this family include the given relay? Loading @@ -40,12 +40,6 @@ impl RelayFamily { } } impl Default for RelayFamily { fn default() -> Self { RelayFamily::new() } } impl std::str::FromStr for RelayFamily { type Err = Error; fn from_str(s: &str) -> Result<Self> { Loading
crates/tor-netdoc/src/types/policy/addrpolicy.rs +3 −9 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ use super::{PolicyError, PortRange}; /// accept *:9000-65535 /// reject *:* /// ``` #[derive(Clone, Debug)] #[derive(Clone, Debug, Default)] pub struct AddrPolicy { /// A list of rules to apply to find out whether an address is /// contained by this policy. Loading Loading @@ -74,14 +74,14 @@ impl AddrPolicy { /// Create a new AddrPolicy that matches nothing. pub fn new() -> Self { AddrPolicy { rules: Vec::new() } AddrPolicy::default() } /// Add a new rule to this policy. /// /// The newly added rule is applied _after_ all previous rules. /// It matches all addresses and ports covered by AddrPortPattern. /// ///nn /// If accept is true, the rule is to accept addresses that match; /// if accept is false, the rule rejects such addresses. pub fn push(&mut self, kind: RuleKind, pattern: AddrPortPattern) { Loading @@ -89,12 +89,6 @@ impl AddrPolicy { } } impl Default for AddrPolicy { fn default() -> Self { AddrPolicy::new() } } /// A single rule in an address policy. /// /// Contains a pattern and what to do with things that match it. Loading