Remove NotificationPowerLevels::is_default

This commit is contained in:
Jonas Platte 2020-05-02 14:16:31 +02:00
parent ca5c65ef10
commit 08418daeb2
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -73,7 +73,7 @@ ruma_event! {
/// The power level requirements for specific notification types.
///
/// 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,
},
}
@ -86,15 +86,6 @@ pub struct NotificationPowerLevels {
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 {
fn default() -> Self {
Self {