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
This commit is contained in:
Jeevitha Kannan K S 2024-11-11 20:45:33 +05:30
parent 10352c6254
commit ae9d58bc57
No known key found for this signature in database
GPG Key ID: 5904C34A2F7CE333

View File

@ -2,7 +2,6 @@ use ratatui::{
style::{Style, Stylize}, style::{Style, Stylize},
text::{Line, Span}, text::{Line, Span},
}; };
use std::borrow::Cow;
pub struct Shortcut { pub struct Shortcut {
pub key_sequences: Vec<Span<'static>>, pub key_sequences: Vec<Span<'static>>,
@ -63,7 +62,7 @@ impl Shortcut {
Self { Self {
key_sequences: key_sequences key_sequences: key_sequences
.iter() .iter()
.map(|s| Span::styled(Cow::<'static, str>::Borrowed(s), Style::default().bold())) .map(|s| Span::styled(*s, Style::default().bold()))
.collect(), .collect(),
desc, desc,
} }