diff options
| -rw-r--r-- | mullvad-relay-selector/src/relay_selector/query.rs | 24 | ||||
| -rw-r--r-- | talpid-types/src/error.rs | 6 |
2 files changed, 30 insertions, 0 deletions
diff --git a/mullvad-relay-selector/src/relay_selector/query.rs b/mullvad-relay-selector/src/relay_selector/query.rs index ff68407051..f37013a5b2 100644 --- a/mullvad-relay-selector/src/relay_selector/query.rs +++ b/mullvad-relay-selector/src/relay_selector/query.rs @@ -109,6 +109,12 @@ impl RelayQuery { } } +impl Default for RelayQuery { + fn default() -> Self { + Self::new() + } +} + impl From<RelayQuery> for RelayConstraints { /// The mapping from [`RelayQuery`] to [`RelayConstraints`]. fn from(value: RelayQuery) -> Self { @@ -163,6 +169,12 @@ impl WireguardRelayQuery { } } +impl Default for WireguardRelayQuery { + fn default() -> Self { + Self::new() + } +} + impl From<WireguardRelayQuery> for WireguardConstraints { /// The mapping from [`WireguardRelayQuery`] to [`WireguardConstraints`]. fn from(value: WireguardRelayQuery) -> Self { @@ -207,6 +219,12 @@ impl OpenVpnRelayQuery { } } +impl Default for OpenVpnRelayQuery { + fn default() -> Self { + Self::new() + } +} + /// This is the reflection of [`BridgeState`] + [`BridgeSettings`] in the "universe of relay /// queries". /// @@ -387,6 +405,12 @@ pub mod builder { } } + impl Default for RelayQueryBuilder<Any> { + fn default() -> Self { + Self::new() + } + } + // Type-safe builder for Wireguard relay constraints. /// Internal builder state for a [`WireguardRelayQuery`] configuration. diff --git a/talpid-types/src/error.rs b/talpid-types/src/error.rs index e4471eff29..70bdaba19b 100644 --- a/talpid-types/src/error.rs +++ b/talpid-types/src/error.rs @@ -102,6 +102,12 @@ pub mod flood { counter: usize, } + impl Default for DetectFlood { + fn default() -> Self { + DetectFlood::new() + } + } + impl DetectFlood { pub const fn new() -> Self { DetectFlood { |
