Skip to content

Commit

Permalink
Make locale_prefs private
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 6, 2025
1 parent 1814f5f commit 9bd4be5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions components/locale_core/src/preferences/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ macro_rules! __define_preferences {
#[non_exhaustive]
pub struct $name {
/// Locale Preferences for the Preferences structure.
pub locale_prefs: $crate::preferences::LocalePreferences,
pub(crate) locale_prefs: $crate::preferences::LocalePreferences,

$(
$(#[$key_doc])*
Expand Down Expand Up @@ -564,6 +564,16 @@ macro_rules! __define_preferences {
}
)*
}

#[doc(hidden)]
pub fn _internal_get_locale_preferences(&self) -> $crate::preferences::LocalePreferences {
self.locale_prefs
}

#[doc(hidden)]
pub fn _internal_set_locale_preferences(&mut self, prefs: $crate::preferences::LocalePreferences) {
self.locale_prefs = prefs;
}
}
)
}
Expand All @@ -578,7 +588,7 @@ macro_rules! __prefs_convert {
impl From<&$name1> for $name2 {
fn from(other: &$name1) -> Self {
let mut result = Self::default();
result.locale_prefs = other.locale_prefs;
result._internal_set_locale_preferences(other._internal_get_locale_preferences());
result
}
}
Expand All @@ -595,7 +605,7 @@ macro_rules! __prefs_convert {
impl From<&$name1> for $name2 {
fn from(other: &$name1) -> Self {
let mut result = Self::default();
result.locale_prefs = other.locale_prefs;
result._internal_set_locale_preferences(other._internal_get_locale_preferences());
$(
result.$key = other.$key;
)*
Expand Down

0 comments on commit 9bd4be5

Please sign in to comment.