diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2024-02-03 19:59:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-03 19:59:12 -0500 |
commit | b6660610d02a88aeb23fbcda8378be67a85259e7 (patch) | |
tree | 630345cf215dc0e894a8a6f70a60eedea71c5d0f /src/utils | |
parent | 8d84b688b004b9c6f383e446a4048cadf1000a31 (diff) |
deps: bump ratatui to 0.26 (#1406)
* deps: bump ratatui to 0.26
* adjust process width
* a few nonzero optimizations
* add a todo
* update comments to be less confusing about time chart
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/general.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/general.rs b/src/utils/general.rs index 20df9bb7..3c0c062a 100644 --- a/src/utils/general.rs +++ b/src/utils/general.rs @@ -1,6 +1,9 @@ use std::{cmp::Ordering, num::NonZeroUsize}; -use tui::text::{Line, Span, Text}; +use tui::{ + style::Style, + text::{Line, Span, Text}, +}; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; @@ -64,6 +67,8 @@ pub fn get_decimal_prefix(quantity: u64, unit: &str) -> (f64, String) { pub fn truncate_to_text<'a, U: Into<usize>>(content: &str, width: U) -> Text<'a> { Text { lines: vec![Line::from(vec![Span::raw(truncate_str(content, width))])], + style: Style::default(), + alignment: None, } } |