Skip to content

Commit

Permalink
Merge pull request #466 from Enet4/imp/dump/terminal_size
Browse files Browse the repository at this point in the history
[dump] Remove term_size in favor of terminal_size
  • Loading branch information
Enet4 authored Mar 16, 2024
2 parents 2f552ae + d07da60 commit 7c0e5ab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 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 dump/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ sop-class = ["dicom-dictionary-std/sop-class"]
cli = ["clap", "dicom-transfer-syntax-registry/inventory-registry", "dicom-object/backtraces"]

[dependencies]
term_size = "0.3.2"
snafu = "0.7.3"
clap = { version = "4.0.18", features = ["derive"], optional = true }
dicom-core = { path = "../core", version = "0.6.3" }
Expand All @@ -34,3 +33,4 @@ dicom-object = { path = "../object/", version = "0.6.3" }
dicom-transfer-syntax-registry = { path = "../transfer-syntax-registry/", version = "0.6.2", default-features = false }
dicom-dictionary-std = { path = "../dictionary-std/", version = "0.6.1" }
owo-colors = { version = "4.0.0-rc.1", features = ["supports-colors"] }
terminal_size = "0.3.0"
2 changes: 1 addition & 1 deletion dump/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ fn cut_str(s: &str, max_characters: u32) -> Cow<str> {

fn determine_width(user_width: Option<u32>) -> u32 {
user_width
.or_else(|| term_size::dimensions().map(|(w, _)| w as u32))
.or_else(|| terminal_size::terminal_size().map(|(w, _)| w.0 as u32))
.unwrap_or(120)
}

Expand Down
2 changes: 1 addition & 1 deletion dump/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn run() -> Result<(), Whatever> {
} = App::parse();

let width = width
.or_else(|| term_size::dimensions().map(|(width, _)| width as u32))
.or_else(|| terminal_size::terminal_size().map(|(width, _)| width.0 as u32))
.unwrap_or(120);

let mut options = DumpOptions::new();
Expand Down

0 comments on commit 7c0e5ab

Please sign in to comment.