Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update terminal-size crate dependency #1297

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.132"
smart-default = "0.7.1"
tempfile = "3.14.0"
terminal_size = "0.3.0"
terminal_size = "0.4.1"
tokio = { version = "1.41.1", features = [
"process",
"macros",
Expand Down
6 changes: 2 additions & 4 deletions src/info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::os::fd::AsRawFd;

use crate::config::{Colors, Config};
use crate::download::cache_info_with_warnings;
use crate::exec;
Expand All @@ -13,7 +11,7 @@ use anyhow::Error;
use globset::GlobSet;
use raur::ArcPackage as Package;
use srcinfo::ArchVec;
use terminal_size::terminal_size_using_fd;
use terminal_size::terminal_size_of;
use tr::tr;
use unicode_width::UnicodeWidthStr;

Expand Down Expand Up @@ -301,5 +299,5 @@ fn print_info<'a>(

#[must_use]
pub fn get_terminal_width() -> Option<usize> {
terminal_size_using_fd(std::io::stdout().as_raw_fd()).map(|(w, _h)| w.0 as usize)
terminal_size_of(std::io::stdout()).map(|(w, _h)| w.0 as usize)
}