From ae9d58bc575129d649d0a47864a061ef2ab1687e Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Mon, 11 Nov 2024 20:45:33 +0530 Subject: [PATCH] Remove Cow for 'static &str Since we are only using borrowed values &str and no owned values there is no need to wrap them in Cow --- tui/src/hint.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tui/src/hint.rs b/tui/src/hint.rs index 2ab4b99d..50d8d4aa 100644 --- a/tui/src/hint.rs +++ b/tui/src/hint.rs @@ -2,7 +2,6 @@ use ratatui::{ style::{Style, Stylize}, text::{Line, Span}, }; -use std::borrow::Cow; pub struct Shortcut { pub key_sequences: Vec>, @@ -63,7 +62,7 @@ impl Shortcut { Self { key_sequences: key_sequences .iter() - .map(|s| Span::styled(Cow::<'static, str>::Borrowed(s), Style::default().bold())) + .map(|s| Span::styled(*s, Style::default().bold())) .collect(), desc, }