diff options
author | Igor Matuszewski <igor@sequoia-pgp.org> | 2019-12-12 03:25:44 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-12-12 14:24:11 +0100 |
commit | 7b0dc8860fa54546304a40b167533edc26eccc73 (patch) | |
tree | c8e1930cab4d0e25b27ab07ddce356386959bfdd /tool/src/commands/decrypt.rs | |
parent | aede3b91ebe3e3486171163f7d90c2b7cefbf7bc (diff) |
tool: Prefer crossterm library over termsize.
- This allows us to get rid of another dependency that uses winapi
0.2, the last being mio 0.6 (0.7 is not yet released). In terms
of linkage we still should only link to what we use - no new
Windows API usage introduced here.
Diffstat (limited to 'tool/src/commands/decrypt.rs')
-rw-r--r-- | tool/src/commands/decrypt.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index 2e2753f6..4186a9f7 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -1,8 +1,8 @@ +use crossterm::terminal; use failure::{self, ResultExt}; use std::collections::HashMap; use std::io; use rpassword; -extern crate termsize; extern crate sequoia_openpgp as openpgp; use sequoia_core::Context; @@ -88,8 +88,8 @@ impl<'a> Helper<'a> { key_hints: hints, dump_session_key: dump_session_key, dumper: if dump || hex { - let width = - termsize::get().map(|s| s.cols as usize).unwrap_or(80); + let width = terminal::size().ok().map(|(cols, _)| cols as usize) + .unwrap_or(80); Some(PacketDumper::new(width, false)) } else { None |