Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 4d7ac04

Browse files
committed
Apply fmt and clippy suggestions
1 parent 40c1c92 commit 4d7ac04

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
//! ```
2929
3030
use anyhow::Result;
31-
use enigo::{Enigo, Key, MouseControllable, KeyboardControllable};
32-
use std::{thread, time::Duration};
3331
use derive_builder::Builder;
32+
use enigo::{Enigo, Key, KeyboardControllable, MouseControllable};
33+
use std::{thread, time::Duration};
3434

3535
mod sys;
3636

@@ -80,7 +80,7 @@ pub struct KeepActive {
8080
_imp: sys::KeepActive,
8181
}
8282

83-
// TODO: gradual movement
83+
// TODO: gradual movement
8484
// exit gracefully on Ctrl+C
8585
pub fn simulate_activity() -> Result<(), Box<dyn std::error::Error>> {
8686
let mut enigo = Enigo::new();

src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use clap_complete::{generate, Shell};
1212
use shadow_rs::shadow;
1313
use sysinfo::{Pid, ProcessRefreshKind, System};
1414

15-
use keep_active::Builder;
1615
use keep_active::simulate_activity;
16+
use keep_active::Builder;
1717

1818
shadow!(build);
1919

@@ -34,7 +34,7 @@ struct Cli {
3434
sleep: bool,
3535

3636
/// Keep status trackers active
37-
#[arg(short = 'a', long)] // Changed short option for status_active
37+
#[arg(short = 'a', long)] // Changed short option for status_active
3838
status_active: bool,
3939

4040
/// Generate shell completions
@@ -43,15 +43,14 @@ struct Cli {
4343

4444
/// Wait for the process with the specified PID to exit.
4545
/// This option is ignored when used with the COMMAND argument.
46-
#[arg(short = 'w', value_name = "PID")] // Changed short option for wait
46+
#[arg(short = 'w', value_name = "PID")] // Changed short option for wait
4747
wait: Option<u32>,
4848

4949
/// Run the command and wait for it to exit, keeping the computer awake while it runs.
5050
#[arg(trailing_var_arg = true, value_hint = ValueHint::CommandWithArguments)]
5151
command: Vec<String>,
5252
}
5353

54-
5554
fn main() -> Result<()> {
5655
let cli = Cli::parse();
5756

0 commit comments

Comments
 (0)