From 222bc5c66f7a4b80c04e805b72c70d0385784b25 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 26 Mar 2023 00:33:26 -0400 Subject: switch from term_size to terminal_size --- Cargo.lock | 12 +----------- Cargo.toml | 2 +- src/data.rs | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d1ab0c..e238608 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ dependencies = [ "hostname", "regex", "term", - "term_size", + "terminal_size", "users", "walkdir", ] @@ -609,16 +609,6 @@ dependencies = [ "winapi", ] -[[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" diff --git a/Cargo.toml b/Cargo.toml index bc0ab09..c258ed3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ git2 = "0.16" hostname = "0.3" regex = "1.7" term = "0.7" -term_size = "0.3" +terminal_size = "0.2.5" users = "0.11" walkdir = "2.3" diff --git a/src/data.rs b/src/data.rs index ae89c9d..d30068e 100644 --- a/src/data.rs +++ b/src/data.rs @@ -69,8 +69,8 @@ fn hostname() -> Option { } fn terminal_cols() -> Option { - if let Some((w, _h)) = term_size::dimensions() { - Some(w) + if let Some((w, _h)) = terminal_size::terminal_size() { + Some(usize::from(w.0)) } else { None } -- cgit v1.2.3-54-g00ecf