diff --git a/Cargo.lock b/Cargo.lock index fb68e237b..2ecd5633d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -432,7 +432,7 @@ dependencies = [ "dicom-transfer-syntax-registry", "owo-colors", "snafu", - "term_size", + "terminal_size", ] [[package]] @@ -1871,13 +1871,13 @@ dependencies = [ ] [[package]] -name = "term_size" -version = "0.3.2" +name = "terminal_size" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "libc", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] diff --git a/dump/Cargo.toml b/dump/Cargo.toml index d165e1b3d..f39da569d 100644 --- a/dump/Cargo.toml +++ b/dump/Cargo.toml @@ -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" } @@ -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" diff --git a/dump/src/lib.rs b/dump/src/lib.rs index e97a85a11..24013fe25 100644 --- a/dump/src/lib.rs +++ b/dump/src/lib.rs @@ -948,7 +948,7 @@ fn cut_str(s: &str, max_characters: u32) -> Cow { fn determine_width(user_width: Option) -> 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) } diff --git a/dump/src/main.rs b/dump/src/main.rs index aa374fccb..46524cf0a 100644 --- a/dump/src/main.rs +++ b/dump/src/main.rs @@ -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();