Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenivaya committed Oct 26, 2024
1 parent 2477444 commit 0864009
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn main() -> Result<()> {
));
}

#[allow(unused_mut)]
let mut monitor = udev_power_monitor::UdevPowerMonitor::new(&mut manager);
monitor.start()
}
6 changes: 6 additions & 0 deletions src/power_state_change_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ pub struct PowerStateChangeManager {
handlers: Vec<Rc<RefCell<Box<dyn PowerStateChangeHandler>>>>,
}

impl Default for PowerStateChangeManager {
fn default() -> Self {
Self::new()
}
}

impl PowerStateChangeManager {
pub fn new() -> Self {
Self {
Expand Down
2 changes: 1 addition & 1 deletion src/udev_power_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a> UdevPowerMonitor<'a> {
}

pub fn start(&mut self) -> Result<()> {
let mut monitor = MonitorBuilder::new()
let monitor = MonitorBuilder::new()
.context("Failed to create udev monitor builder")?
.match_subsystem_devtype("power_supply", "power_supply")
.context("Failed to match subsystem and devtype")?
Expand Down

0 comments on commit 0864009

Please sign in to comment.