Skip to content

Commit

Permalink
Remove Cow for 'static &str
Browse files Browse the repository at this point in the history
Since we are only using borrowed values &str and no owned values there is no need to wrap them in Cow
  • Loading branch information
jeevithakannan2 committed Nov 11, 2024
1 parent 10352c6 commit ae9d58b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tui/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use ratatui::{
style::{Style, Stylize},
text::{Line, Span},
};
use std::borrow::Cow;

pub struct Shortcut {
pub key_sequences: Vec<Span<'static>>,
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit ae9d58b

Please sign in to comment.