summaryrefslogtreecommitdiffstats
path: root/src/app/widgets/tui_stuff/block_builder.rs
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2021-11-23 22:34:50 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2021-11-23 22:34:50 -0500
commite89d46e10ff316e707687d0f60517e33ce5f07a3 (patch)
treea56dc0c1aa2fb0cd4b26c15f678b314b71f519ae /src/app/widgets/tui_stuff/block_builder.rs
parent16babea2021686b0189ff104d73e71127129ca3c (diff)
refactor: Add CPU load back
Diffstat (limited to 'src/app/widgets/tui_stuff/block_builder.rs')
-rw-r--r--src/app/widgets/tui_stuff/block_builder.rs8
1 files changed, 5 insertions, 3 deletions
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<String>,
}
impl BlockBuilder {
/// Creates a new [`BlockBuilder`] with the name of block.
- pub fn new(name: &'static str) -> Self {
+ pub fn new<S: Into<Cow<'static, str>>>(name: S) -> Self {
Self {
borders: Borders::ALL,
selected: false,
show_esc: false,
- name,
+ name: name.into(),
hide_title: false,
extra_text: None,
}