From 1db06d90067ad8ce1e6e5a808acddd16aac3adec Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Sun, 6 Apr 2025 17:35:16 +0300 Subject: use dyn trait upcasting --- src/wm_info_provider/dummy.rs | 6 +----- src/wm_info_provider/hyprland.rs | 4 ---- src/wm_info_provider/niri.rs | 4 ---- src/wm_info_provider/river.rs | 4 ---- 4 files changed, 1 insertion(+), 17 deletions(-) (limited to 'src/wm_info_provider') diff --git a/src/wm_info_provider/dummy.rs b/src/wm_info_provider/dummy.rs index 72903c7..9b1ad9a 100644 --- a/src/wm_info_provider/dummy.rs +++ b/src/wm_info_provider/dummy.rs @@ -2,8 +2,4 @@ use super::*; pub struct DummyInfoProvider; -impl WmInfoProvider for DummyInfoProvider { - fn as_any(&mut self) -> &mut dyn Any { - self - } -} +impl WmInfoProvider for DummyInfoProvider {} diff --git a/src/wm_info_provider/hyprland.rs b/src/wm_info_provider/hyprland.rs index 6deeec1..52fd4eb 100644 --- a/src/wm_info_provider/hyprland.rs +++ b/src/wm_info_provider/hyprland.rs @@ -104,10 +104,6 @@ impl WmInfoProvider for HyprlandInfoProvider { _ => (), } } - - fn as_any(&mut self) -> &mut dyn Any { - self - } } fn hyprland_cb(conn: &mut Connection, state: &mut State) -> io::Result<()> { diff --git a/src/wm_info_provider/niri.rs b/src/wm_info_provider/niri.rs index 9f37c3b..48addeb 100644 --- a/src/wm_info_provider/niri.rs +++ b/src/wm_info_provider/niri.rs @@ -114,10 +114,6 @@ impl WmInfoProvider for NiriInfoProvider { _ => (), } } - - fn as_any(&mut self) -> &mut dyn Any { - self - } } fn niri_cb(conn: &mut Connection, state: &mut State) -> io::Result<()> { diff --git a/src/wm_info_provider/river.rs b/src/wm_info_provider/river.rs index 9af3385..c0321ee 100644 --- a/src/wm_info_provider/river.rs +++ b/src/wm_info_provider/river.rs @@ -144,10 +144,6 @@ impl WmInfoProvider for RiverInfoProvider { _ => (), } } - - fn as_any(&mut self) -> &mut dyn Any { - self - } } fn output_status_cb(ctx: EventCtx) { -- cgit v1.3.1