summaryrefslogtreecommitdiff
path: root/runtime/ops/tty.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-07-15 12:30:25 -0400
committerGitHub <noreply@github.com>2022-07-15 12:30:25 -0400
commit635eed93731c3616cacf53860b9aeeeb8cfe158b (patch)
tree04509d5720189fe12b2021500c461ccea1ddfa8e /runtime/ops/tty.rs
parentee0c0586b318fe23908a3b9b4311b26d79c5c8a1 (diff)
chore: fix Windows specific clippy errors (#15212)
Diffstat (limited to 'runtime/ops/tty.rs')
-rw-r--r--runtime/ops/tty.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs
index ab9553025..2018f954d 100644
--- a/runtime/ops/tty.rs
+++ b/runtime/ops/tty.rs
@@ -95,6 +95,7 @@ fn op_set_raw(state: &mut OpState, args: SetRawArgs) -> Result<(), AnyError> {
return Err(custom_error("ReferenceError", "null handle"));
}
let mut original_mode: DWORD = 0;
+ // SAFETY: winapi call
if unsafe { consoleapi::GetConsoleMode(handle, &mut original_mode) }
== FALSE
{
@@ -105,6 +106,7 @@ fn op_set_raw(state: &mut OpState, args: SetRawArgs) -> Result<(), AnyError> {
} else {
original_mode | RAW_MODE_MASK
};
+ // SAFETY: winapi call
if unsafe { consoleapi::SetConsoleMode(handle, new_mode) } == FALSE {
return Err(Error::last_os_error().into());
}
@@ -210,6 +212,7 @@ fn op_console_size(
use std::os::windows::io::AsRawHandle;
let handle = std_file.as_raw_handle();
+ // SAFETY: winapi calls
unsafe {
let mut bufinfo: winapi::um::wincon::CONSOLE_SCREEN_BUFFER_INFO =
std::mem::zeroed();