Skip to content

Commit

Permalink
Keep Rustfmt happy
Browse files Browse the repository at this point in the history
  • Loading branch information
haimgel committed Oct 25, 2023
1 parent d041246 commit 2369a31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/platform/wake_displays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ pub fn wake_displays() -> Result<()> {
use std::{thread, time};
use uinput::event::controller::Controller::Mouse;
use uinput::event::controller::Mouse::Left;
use uinput::event::Event::{Controller, Relative};
use uinput::event::relative::Position::X;
use uinput::event::relative::Relative::Position;
use uinput::event::Event::{Controller, Relative};

let mut device = uinput::default()?
.name("display-switch")?
Expand All @@ -54,7 +54,6 @@ pub fn wake_displays() -> Result<()> {
.event(Relative(Position(X)))?
.create()?;


// This sleep appears to be necessary based on testing.
// Possibly X does not immediately recognize the new device?
thread::sleep(time::Duration::from_secs(1));
Expand All @@ -75,7 +74,11 @@ mod tests {
fn test_wake_displays() {
let waked = wake_displays();
if let Err(err) = &waked {
assert!(err.to_string() == "Permission denied", "Couldn't wake displays: {:?}", err);
assert!(
err.to_string() == "Permission denied",
"Couldn't wake displays: {:?}",
err
);
}
}
}

0 comments on commit 2369a31

Please sign in to comment.