commit
7dba56f97b
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -333,7 +333,6 @@ dependencies = [
|
||||
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -346,7 +345,7 @@ dependencies = [
|
||||
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -58,5 +58,4 @@ lazy_static = "1.0.0"
|
||||
libc = "0.2.11"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
kernel32-sys = "0.2.2"
|
||||
winapi = "0.2.7"
|
||||
winapi = { version = "0.3" }
|
||||
|
@ -382,13 +382,12 @@ pub fn isatty() -> bool {
|
||||
}
|
||||
#[cfg(windows)]
|
||||
pub fn isatty() -> bool {
|
||||
extern crate kernel32;
|
||||
extern crate winapi;
|
||||
|
||||
unsafe {
|
||||
let handle = kernel32::GetStdHandle(winapi::winbase::STD_OUTPUT_HANDLE);
|
||||
let handle = winapi::um::processenv::GetStdHandle(winapi::um::winbase::STD_OUTPUT_HANDLE);
|
||||
let mut out = 0;
|
||||
kernel32::GetConsoleMode(handle, &mut out) != 0
|
||||
winapi::um::consoleapi::GetConsoleMode(handle, &mut out) != 0
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user