Skip to content

Commit

Permalink
clippy windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Apr 7, 2024
1 parent 5de294c commit 2911a8a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/uu/stty/src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ fn set_echo_mode(on: bool) {
let mut mode = CONSOLE_MODE::default();
unsafe { GetConsoleMode(stdin_h, &mut mode) }.unwrap();

match on {
true => mode |= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT,
false => mode &= !ENABLE_ECHO_INPUT,
};
if on {
mode |= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT;
} else {
mode &= !ENABLE_ECHO_INPUT;
}

unsafe { SetConsoleMode(stdin_h, mode) }.unwrap();
}
Expand All @@ -47,8 +48,7 @@ fn get_echo_mode() -> bool {
let mut mode = CONSOLE_MODE::default();
unsafe { GetConsoleMode(stdin_h, &mut mode) }.unwrap();

let on = (mode & ENABLE_ECHO_INPUT).0 != 0;
on
(mode & ENABLE_ECHO_INPUT).0 != 0
}

fn apply_setting(setting: &str) -> UResult<()> {
Expand Down

0 comments on commit 2911a8a

Please sign in to comment.