Skip to content

Commit 9f16e96

Browse files
committed
use terminal_size instead of inlining it
1 parent 43df992 commit 9f16e96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/volta-core/src/style.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use archive::Origin;
77
use cfg_if::cfg_if;
88
use console::{style, StyledObject};
99
use indicatif::{ProgressBar, ProgressStyle};
10+
use terminal_size::{terminal_size, Width};
1011

1112
pub const MAX_WIDTH: usize = 100;
1213
const MAX_PROGRESS_WIDTH: usize = 40;
@@ -49,8 +50,7 @@ where
4950

5051
/// Get the width of the terminal, limited to a maximum of MAX_WIDTH
5152
pub fn text_width() -> Option<usize> {
52-
use terminal_size::Width;
53-
terminal_size::terminal_size().map(|(Width(w), _)| (w as usize).min(MAX_WIDTH))
53+
terminal_size().map(|(Width(w), _)| (w as usize).min(MAX_WIDTH))
5454
}
5555

5656
/// Constructs a command-line progress bar based on the specified Origin enum

0 commit comments

Comments
 (0)