Skip to content

Commit e16a82d

Browse files
committed
improv: Remove unused code
1 parent dc12649 commit e16a82d

File tree

4 files changed

+3
-46
lines changed

4 files changed

+3
-46
lines changed

examples/daemon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn main() {
7373
}
7474
}
7575

76-
with_daemon(|mut daemon| {
76+
with_daemon(|daemon| {
7777
println!("boards: {:?}", daemon.boards());
7878
});
7979
}

src/application/keyboard.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use std::{
1010
Path,
1111
},
1212
rc::Rc,
13-
str::{
14-
self,
15-
FromStr
16-
},
13+
str,
1714
};
1815

1916
use crate::daemon::Daemon;
@@ -442,21 +439,6 @@ button {
442439
..set_halign(gtk::Align::Start);
443440
};
444441

445-
let color_rgba = if let Some(ref daemon) = self.daemon_opt {
446-
match daemon.color(self.daemon_board) {
447-
Ok(value) => {
448-
let (red, green, blue) = value.to_floats();
449-
gdk::RGBA { red, green, blue, alpha: 1. }
450-
},
451-
Err(err) => {
452-
eprintln!("{}", err);
453-
gdk::RGBA::black()
454-
}
455-
}
456-
} else {
457-
gdk::RGBA::black()
458-
};
459-
460442
let color_keyboard = if let Some(ref daemon) = self.daemon_opt {
461443
ColorKeyboard::new_daemon(daemon.clone(), self.daemon_board)
462444
} else {

src/keyboard.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ use crate::daemon::Daemon;
1616
const DBUS_NAME: &'static str = "com.system76.PowerDaemon";
1717
const DBUS_KEYBOARD_IFACE: &'static str = "com.system76.PowerDaemon.Keyboard";
1818

19-
pub enum KeyboardPattern {
20-
Solid,
21-
Breathe,
22-
Wave,
23-
Snake,
24-
Random,
25-
}
26-
2719
enum KeyboardImplementation {
2820
#[cfg(target_os = "linux")]
2921
S76Power {
@@ -314,23 +306,6 @@ impl Keyboard {
314306
.borrow_mut()
315307
.push(std::boxed::Box::new(f) as Box<dyn Fn(&Self, Rgb)>);
316308
}
317-
318-
/// Returns `true` if the keyboard has a backlight capable of patterns
319-
pub fn has_pattern(&self) -> Result<bool> {
320-
Ok(false)
321-
}
322-
323-
/// Gets backlight pattern
324-
pub fn pattern(&self) -> Result<KeyboardPattern> {
325-
// XXX
326-
Ok(KeyboardPattern::Solid)
327-
}
328-
329-
/// Sets backlight pattern
330-
pub fn set_pattern(&self, _pattern: KeyboardPattern) -> Result<()> {
331-
// XXX
332-
Ok(())
333-
}
334309
}
335310

336311
impl fmt::Display for Keyboard {

src/keyboard_color_button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::rc::{Rc, Weak};
99
use crate::choose_color::choose_color;
1010
use crate::color::Rgb;
1111
use crate::color_circle::{ColorCircle, ColorCircleSymbol};
12-
use crate::keyboard::{keyboards, Keyboard};
12+
use crate::keyboard::Keyboard;
1313

1414
struct KeyboardColorButtonInner {
1515
button: ColorCircle,

0 commit comments

Comments
 (0)