Skip to content

Commit

Permalink
Remove trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibi Braniecki committed Jun 2, 2022
1 parent f03d476 commit 7368973
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
32 changes: 16 additions & 16 deletions utils/preferences/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#[macro_export]
macro_rules! preferences {
($trait:ident, $name:ident, $resolved_name:ident, {$($key:ident => $pref:ty, $resolved:ty, $ue:expr),*}) => (
pub trait $trait: Preferences {
$(
fn $key(&self) -> $pref {
None
}
)*
}
($name:ident, $resolved_name:ident, {$($key:ident => $pref:ty, $resolved:ty, $ue:expr),*}) => (
// pub trait $trait: Preferences {
// $(
// fn $key(&self) -> $pref {
// None
// }
// )*
// }

#[derive(Default)]
#[non_exhaustive]
Expand Down Expand Up @@ -43,13 +43,13 @@ macro_rules! preferences {
}
}

impl $trait for $name {
$(
fn $key(&self) -> $pref {
self.$key
}
)*
}
// impl $trait for $name {
// $(
// fn $key(&self) -> $pref {
// self.$key
// }
// )*
// }

impl TryFrom<Locale> for $name {
type Error = ();
Expand Down Expand Up @@ -121,7 +121,7 @@ macro_rules! preferences {
language = &self.lid.language;
}
$(
if let Some(v) = prefs.$key() {
if let Some(v) = prefs.$key {
self.$key = v;
}
)*
Expand Down
1 change: 0 additions & 1 deletion utils/preferences/tests/dtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ impl TryFrom<&icu_locid::extensions::unicode::Value> for Calendar {
}

preferences!(
DTFPreferences,
DTFPreferencesBag,
ResolvedDTFPreferencesBag,
{
Expand Down

0 comments on commit 7368973

Please sign in to comment.