From 08418daeb2da772a6fb735e65c471ce3ecb3b1b6 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 2 May 2020 14:16:31 +0200 Subject: [PATCH] Remove NotificationPowerLevels::is_default --- src/room/power_levels.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/room/power_levels.rs b/src/room/power_levels.rs index 7b0c0f0d..9b74e645 100644 --- a/src/room/power_levels.rs +++ b/src/room/power_levels.rs @@ -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 {