Skip to content

Commit 2742093

Browse files
authored
Merge pull request #6210 from fdefelici/fix/clippy-win
fix: clippy error on windows
2 parents f8e817c + 2bfd0cb commit 2742093

File tree

1 file changed

+5
-1
lines changed
  • stacks-common/src/deps_common/ctrlc

1 file changed

+5
-1
lines changed

stacks-common/src/deps_common/ctrlc/tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ mod platform {
130130
}
131131

132132
unsafe fn get_stdout() -> io::Result<HANDLE> {
133+
use std::ffi::CString;
134+
133135
use winapi::um::fileapi::{CreateFileA, OPEN_EXISTING};
134136
use winapi::um::handleapi::INVALID_HANDLE_VALUE;
135137
use winapi::um::winnt::{FILE_SHARE_WRITE, GENERIC_READ, GENERIC_WRITE};
136138

139+
let conout = CString::new("CONOUT$").expect("CString::new failed");
140+
137141
let stdout = CreateFileA(
138-
"CONOUT$\0".as_ptr() as *const CHAR,
142+
conout.as_ptr() as *const CHAR,
139143
GENERIC_READ | GENERIC_WRITE,
140144
FILE_SHARE_WRITE,
141145
ptr::null_mut(),

0 commit comments

Comments
 (0)