Remove NotificationPowerLevels::is_default
This commit is contained in:
parent
ca5c65ef10
commit
08418daeb2
@ -73,7 +73,7 @@ ruma_event! {
|
|||||||
/// The power level requirements for specific notification types.
|
/// The power level requirements for specific notification types.
|
||||||
///
|
///
|
||||||
/// This is a mapping from `key` to power level for that notifications key.
|
/// This is a mapping from `key` to power level for that notifications key.
|
||||||
#[serde(default, skip_serializing_if = "NotificationPowerLevels::is_default")]
|
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||||
pub notifications: NotificationPowerLevels,
|
pub notifications: NotificationPowerLevels,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -86,15 +86,6 @@ pub struct NotificationPowerLevels {
|
|||||||
pub room: Int,
|
pub room: Int,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NotificationPowerLevels {
|
|
||||||
// TODO: Make public under this name?
|
|
||||||
// pass-by-ref required for #[serde(skip_serializing_if)]
|
|
||||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
|
||||||
fn is_default(&self) -> bool {
|
|
||||||
*self == Self::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for NotificationPowerLevels {
|
impl Default for NotificationPowerLevels {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user