Skip to content

Commit

Permalink
perf: use ratatui raw over from methods
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Oct 24, 2023
1 parent a6cefb8 commit 2620e09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/interactive/clean_retained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ pub fn draw_popup(f: &mut Frame, topic: &str) {
.title_alignment(Alignment::Center)
.title("Clean retained topics");
let text = vec![
Line::from("Clean the following topic and all relative below?"),
Line::raw("Clean the following topic and all relative below?"),
Line::styled(
topic,
Style::new().add_modifier(Modifier::BOLD | Modifier::ITALIC),
),
Line::from(""),
Line::from("Confirm with Enter, abort with Esc"),
Line::raw(""),
Line::raw("Confirm with Enter, abort with Esc"),
];
let paragraph = Paragraph::new(text)
.block(block)
Expand Down
14 changes: 7 additions & 7 deletions src/interactive/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ impl Footer {
let line = Line::from(match focus {
ElementInFocus::TopicOverview => vec![
Span::styled("q", STYLE),
Span::from(" Quit "),
Span::raw(" Quit "),
Span::styled("Tab", STYLE),
Span::from(" Switch to JSON Payload "),
Span::raw(" Switch to JSON Payload "),
Span::styled("Del", STYLE),
Span::from(" Clean retained "),
Span::raw(" Clean retained "),
],
ElementInFocus::JsonPayload => vec![
Span::styled("q", STYLE),
Span::from(" Quit "),
Span::raw(" Quit "),
Span::styled("Tab", STYLE),
Span::from(" Switch to Topics "),
Span::raw(" Switch to Topics "),
],
ElementInFocus::CleanRetainedPopup(_) => vec![
Span::styled("Enter", STYLE),
Span::from(" Clean topic tree "),
Span::raw(" Clean topic tree "),
Span::styled("Any", STYLE),
Span::from(" Abort "),
Span::raw(" Abort "),
],
});
let remaining = area.width as usize - line.width();
Expand Down

0 comments on commit 2620e09

Please sign in to comment.