aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-02-18 18:18:16 -0500
committerJesse Luehrs <doy@tozt.net>2023-02-18 18:18:16 -0500
commit71fd9206176ab8a22969dcfc01772851604f99e7 (patch)
tree17503927281d10e475e270dcd0a5507a29a971e4
parent1fdbfb62ab7716cbc39a8575cd82b575beecf3bd (diff)
downloadrbw-71fd9206176ab8a22969dcfc01772851604f99e7.tar.gz
rbw-71fd9206176ab8a22969dcfc01772851604f99e7.zip
replace term_size with terminal_size
-rw-r--r--Cargo.lock12
-rw-r--r--Cargo.toml2
-rw-r--r--src/bin/rbw/main.rs6
3 files changed, 6 insertions, 14 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 1a311b0..a40ac8f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1050,7 +1050,7 @@ dependencies = [
"sha1",
"sha2",
"tempfile",
- "term_size",
+ "terminal_size",
"textwrap",
"thiserror",
"tokio",
@@ -1499,16 +1499,6 @@ dependencies = [
]
[[package]]
-name = "term_size"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 8f6bd27..cfe1a33 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -46,7 +46,7 @@ serde_repr = "0.1.10"
sha1 = "0.10.5"
sha2 = "0.10.6"
tempfile = "3.3.0"
-term_size = "0.3.2"
+terminal_size = "0.2.5"
textwrap = "0.16.0"
thiserror = "1.0.38"
tokio = { version = "1.25.0", features = ["full"] }
diff --git a/src/bin/rbw/main.rs b/src/bin/rbw/main.rs
index 97784b7..cdfcc39 100644
--- a/src/bin/rbw/main.rs
+++ b/src/bin/rbw/main.rs
@@ -288,9 +288,11 @@ fn main() {
env_logger::Env::default().default_filter_or("info"),
)
.format(|buf, record| {
- if let Some((w, _)) = term_size::dimensions() {
+ if let Some((terminal_size::Width(w), _)) =
+ terminal_size::terminal_size()
+ {
let out = format!("{}: {}", record.level(), record.args());
- writeln!(buf, "{}", textwrap::fill(&out, w - 1))
+ writeln!(buf, "{}", textwrap::fill(&out, usize::from(w) - 1))
} else {
writeln!(buf, "{}: {}", record.level(), record.args())
}