From 835774a5a764aa5022db25301467e396889ab779 Mon Sep 17 00:00:00 2001 From: Lucy Date: Wed, 16 Feb 2022 10:56:27 -0500 Subject: [PATCH] Remove unused code --- .../cosmic-applet-graphics/src/graphics.rs | 11 -------- applets/cosmic-applet-graphics/src/main.rs | 1 - applets/cosmic-applet-graphics/src/profile.rs | 27 ------------------- 3 files changed, 39 deletions(-) delete mode 100644 applets/cosmic-applet-graphics/src/profile.rs diff --git a/applets/cosmic-applet-graphics/src/graphics.rs b/applets/cosmic-applet-graphics/src/graphics.rs index 339c3153..c95835a6 100644 --- a/applets/cosmic-applet-graphics/src/graphics.rs +++ b/applets/cosmic-applet-graphics/src/graphics.rs @@ -21,17 +21,6 @@ pub async fn get_current_graphics(daemon: &PowerDaemonProxy<'_>) -> Result) -> Result { - let graphics = daemon.get_default_graphics().await?; - match graphics.as_str() { - "integrated" => Ok(Graphics::Integrated), - "hybrid" => Ok(Graphics::Hybrid), - "nvidia" => Ok(Graphics::Nvidia), - "compute" => Ok(Graphics::Compute), - _ => panic!("Unknown graphics profile: {}", graphics), - } -} - pub async fn set_graphics(daemon: &PowerDaemonProxy<'_>, graphics: Graphics) -> Result<()> { let graphics_str = match graphics { Graphics::Integrated => "integrated", diff --git a/applets/cosmic-applet-graphics/src/main.rs b/applets/cosmic-applet-graphics/src/main.rs index 13b982bd..6ee419cd 100644 --- a/applets/cosmic-applet-graphics/src/main.rs +++ b/applets/cosmic-applet-graphics/src/main.rs @@ -8,7 +8,6 @@ extern crate relm4_macros; pub mod dbus; pub mod graphics; pub mod mode_box; -pub mod profile; use self::{dbus::PowerDaemonProxy, graphics::Graphics, mode_box::ModeSelection}; use gtk4::{ diff --git a/applets/cosmic-applet-graphics/src/profile.rs b/applets/cosmic-applet-graphics/src/profile.rs deleted file mode 100644 index 6fef433d..00000000 --- a/applets/cosmic-applet-graphics/src/profile.rs +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -use crate::dbus::PowerDaemonProxy; -use zbus::Result; - -pub enum Profile { - Performance, - Balanced, - Battery, -} - -pub async fn get_current_profile(daemon: &PowerDaemonProxy<'_>) -> Result { - let profile = daemon.get_profile().await?; - match profile.as_str() { - "Performance" => Ok(Profile::Performance), - "Balanced" => Ok(Profile::Balanced), - "Battery" => Ok(Profile::Battery), - _ => panic!("Unknown profile: {}", profile), - } -} - -pub async fn set_profile(daemon: &PowerDaemonProxy<'_>, profile: Profile) -> zbus::Result<()> { - match profile { - Profile::Performance => daemon.performance().await, - Profile::Balanced => daemon.balanced().await, - Profile::Battery => daemon.battery().await, - } -}