Rollup merge of #68626 - Zoxc:termize, r=estebank

Use termize instead of term_size

`termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency.

r? @Mark-Simulacrum
This commit is contained in:
Dylan DPC 2020-01-30 01:46:43 +01:00 committed by GitHub
commit 4af33a9c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -3540,8 +3540,8 @@ dependencies = [
"rustc_data_structures",
"rustc_span",
"serialize",
"term_size",
"termcolor",
"termize",
"unicode-width",
"winapi 0.3.8",
]
@ -4580,6 +4580,16 @@ dependencies = [
"redox_termios",
]
[[package]]
name = "termize"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1706be6b564323ce7092f5f7e6b118a14c8ef7ed0e69c8c5329c914a9f101295"
dependencies = [
"libc",
"winapi 0.3.8",
]
[[package]]
name = "test"
version = "0.0.0"

View File

@ -18,7 +18,7 @@ unicode-width = "0.1.4"
atty = "0.2"
termcolor = "1.0"
annotate-snippets = "0.6.1"
term_size = "0.3.1"
termize = "0.1.1"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["handleapi", "synchapi", "winbase"] }

View File

@ -1367,7 +1367,7 @@ impl EmitterWriter {
} else if self.ui_testing {
140
} else {
term_size::dimensions()
termize::dimensions()
.map(|(w, _)| w.saturating_sub(code_offset))
.unwrap_or(std::usize::MAX)
};

View File

@ -167,7 +167,7 @@ const WHITELIST: &[Crate<'_>] = &[
Crate("termcolor"),
Crate("terminon"),
Crate("termion"),
Crate("term_size"),
Crate("termize"),
Crate("thread_local"),
Crate("ucd-util"),
Crate("unicode-normalization"),