From 71fd9206176ab8a22969dcfc01772851604f99e7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 18 Feb 2023 18:18:16 -0500 Subject: replace term_size with terminal_size --- src/bin/rbw/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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()) } -- cgit v1.2.3-54-g00ecf