diff --git a/mullvad-relay-selector/src/relay_selector/query.rs b/mullvad-relay-selector/src/relay_selector/query.rs index ecb4bd3d872f..d5b17b2303b3 100644 --- a/mullvad-relay-selector/src/relay_selector/query.rs +++ b/mullvad-relay-selector/src/relay_selector/query.rs @@ -458,7 +458,7 @@ impl Intersection for Providers { where Self: Sized, { - Providers::new(self.providers.intersection(&other.providers)).ok() + Providers::new(self.providers().intersection(other.providers())).ok() } } diff --git a/mullvad-types/src/relay_constraints.rs b/mullvad-types/src/relay_constraints.rs index ffb13a2792eb..11f27156b3b9 100644 --- a/mullvad-types/src/relay_constraints.rs +++ b/mullvad-types/src/relay_constraints.rs @@ -393,7 +393,7 @@ pub type Provider = String; #[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] #[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)] pub struct Providers { - pub providers: HashSet, + providers: HashSet, } /// Returned if the iterator contained no providers. @@ -416,6 +416,11 @@ impl Providers { pub fn into_vec(self) -> Vec { self.providers.into_iter().collect() } + + /// Access the underlying set of [providers][`Provider`] + pub fn providers(&self) -> &HashSet { + &self.providers + } } impl Match for Providers {