diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-02-18 18:18:16 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-02-18 18:18:16 -0500 |
commit | 71fd9206176ab8a22969dcfc01772851604f99e7 (patch) | |
tree | 17503927281d10e475e270dcd0a5507a29a971e4 /src | |
parent | 1fdbfb62ab7716cbc39a8575cd82b575beecf3bd (diff) | |
download | rbw-71fd9206176ab8a22969dcfc01772851604f99e7.tar.gz rbw-71fd9206176ab8a22969dcfc01772851604f99e7.zip |
replace term_size with terminal_size
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/rbw/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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()) } |