Skip to content

Commit

Permalink
refactor(clippy): apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Aug 30, 2024
1 parent 399a36b commit 8dbcca5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/tui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,11 @@ pub fn render_key_bindings(state: &mut State, frame: &mut Frame, rect: Rect) {
})
.collect::<Vec<Span>>(),
);
if line.width() as u16 > chunks[1].width.saturating_sub(25) {
if get_input_line(state).width() != 0
&& (state.tab != Tab::StaticAnalysis || state.tab != Tab::Hexdump)
{
return;
}
if line.width() as u16 > chunks[1].width.saturating_sub(25)
&& get_input_line(state).width() != 0
&& (state.tab != Tab::StaticAnalysis || state.tab != Tab::Hexdump)
{
return;
}
frame.render_widget(Paragraph::new(line.alignment(Alignment::Center)), chunks[1]);
}
Expand Down Expand Up @@ -534,11 +533,13 @@ pub fn render_static_analysis(state: &mut State, frame: &mut Frame, rect: Rect)
"File Headers".white().bold(),
"|".fg(Color::Rgb(100, 100, 100)),
])
.border_style(Style::default().fg(if state.block_index == 0 {
Color::Yellow
} else {
Color::Rgb(100, 100, 100)
})),
.border_style({
if state.block_index == 0 {
Style::default().fg(Color::White).bold()
} else {
Style::default().fg(Color::Rgb(100, 100, 100))
}
}),
)
.scroll((state.headers_scroll_index as u16, 0))
.wrap(Wrap { trim: true }),
Expand Down

0 comments on commit 8dbcca5

Please sign in to comment.