String optimizations
This commit is contained in:
parent
6109785e63
commit
3929a4a277
2 changed files with 13 additions and 13 deletions
|
|
@ -3,7 +3,7 @@ use crate::data::heartbeat::model::HeartbeatEntry;
|
|||
use crate::i18n::t;
|
||||
use ratatui::widgets::ScrollbarState;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use std::borrow::Cow;
|
||||
pub const BORDER_LINES_VIEW: usize = 3;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
|
@ -15,7 +15,7 @@ pub enum MonitorStatus {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MonitorViewState {
|
||||
pub name: String,
|
||||
pub name: Cow<'static, str>,
|
||||
pub status: MonitorStatus,
|
||||
pub response_time: String,
|
||||
pub uptime_24h: String,
|
||||
|
|
@ -141,7 +141,7 @@ fn add_monitor_view_state(group: UnifiedGroupData) -> Vec<MonitorViewState> {
|
|||
.unwrap_or_else(|| t("unknown").to_string());
|
||||
|
||||
MonitorViewState {
|
||||
name: monitor.name,
|
||||
name: Cow::Owned(monitor.name),
|
||||
status,
|
||||
response_time,
|
||||
uptime_24h,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue