From e89d46e10ff316e707687d0f60517e33ce5f07a3 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Tue, 23 Nov 2021 22:34:50 -0500 Subject: refactor: Add CPU load back --- src/app/widgets/tui_stuff/block_builder.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/app/widgets/tui_stuff/block_builder.rs') diff --git a/src/app/widgets/tui_stuff/block_builder.rs b/src/app/widgets/tui_stuff/block_builder.rs index cec835e3..9b503ed6 100644 --- a/src/app/widgets/tui_stuff/block_builder.rs +++ b/src/app/widgets/tui_stuff/block_builder.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use tui::{ layout::Rect, text::Span, @@ -11,19 +13,19 @@ pub struct BlockBuilder { borders: Borders, selected: bool, show_esc: bool, - name: &'static str, + name: Cow<'static, str>, hide_title: bool, extra_text: Option, } impl BlockBuilder { /// Creates a new [`BlockBuilder`] with the name of block. - pub fn new(name: &'static str) -> Self { + pub fn new>>(name: S) -> Self { Self { borders: Borders::ALL, selected: false, show_esc: false, - name, + name: name.into(), hide_title: false, extra_text: None, } -- cgit v1.2.3