We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
use terminal_size
1 parent 43df992 commit 9f16e96Copy full SHA for 9f16e96
crates/volta-core/src/style.rs
@@ -7,6 +7,7 @@ use archive::Origin;
7
use cfg_if::cfg_if;
8
use console::{style, StyledObject};
9
use indicatif::{ProgressBar, ProgressStyle};
10
+use terminal_size::{terminal_size, Width};
11
12
pub const MAX_WIDTH: usize = 100;
13
const MAX_PROGRESS_WIDTH: usize = 40;
@@ -49,8 +50,7 @@ where
49
50
51
/// Get the width of the terminal, limited to a maximum of MAX_WIDTH
52
pub fn text_width() -> Option<usize> {
- use terminal_size::Width;
53
- terminal_size::terminal_size().map(|(Width(w), _)| (w as usize).min(MAX_WIDTH))
+ terminal_size().map(|(Width(w), _)| (w as usize).min(MAX_WIDTH))
54
}
55
56
/// Constructs a command-line progress bar based on the specified Origin enum
0 commit comments