Skip to content

Commit 60acc7f

Browse files
Fmt and clippy
1 parent eaa45a7 commit 60acc7f

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/tui/ui/tabs/flightsql.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use ratatui::{
1919
buffer::Buffer,
2020
layout::{Alignment, Constraint, Direction, Layout, Rect},
2121
style::{palette::tailwind, Style, Stylize},
22-
text::Span,
23-
widgets::{block::Title, Block, Borders, Paragraph, Row, StatefulWidget, Table, Widget, Wrap},
22+
text::{Line, Span},
23+
widgets::{Block, Borders, Paragraph, Row, StatefulWidget, Table, Widget, Wrap},
2424
};
2525

2626
use crate::tui::ui::convert::record_batch_to_table;
@@ -55,7 +55,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
5555
let block = Block::default()
5656
.title(" Results ")
5757
.borders(Borders::ALL)
58-
.title(Title::from(" Page ").alignment(Alignment::Right));
58+
.title_top(Line::from(" Page ").right_aligned());
5959
let row = Row::new(vec!["Executing query..."]);
6060
let widths = vec![Constraint::Percentage(100)];
6161
let table = Table::new(vec![row], widths).block(block);
@@ -66,7 +66,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
6666
let block = Block::default()
6767
.title(" Results ")
6868
.borders(Borders::ALL)
69-
.title(Title::from(format!(" Page {page} ")).alignment(Alignment::Right));
69+
.title_top(Line::from(format!(" Page {page} ")).right_aligned());
7070
let maybe_table = record_batch_to_table(&batch);
7171

7272
let block = block.title_bottom("Stats").fg(tailwind::ORANGE.c500);
@@ -94,7 +94,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
9494
let block = Block::default()
9595
.title(" Results ")
9696
.borders(Borders::ALL)
97-
.title(Title::from(" Page ").alignment(Alignment::Right))
97+
.title_top(Line::from(" Page ").right_aligned())
9898
.title_bottom(format!(" {}ms ", dur));
9999
let p = Paragraph::new(e.error().to_string())
100100
.block(block)
@@ -105,7 +105,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
105105
let block = Block::default()
106106
.title(" Results ")
107107
.borders(Borders::ALL)
108-
.title(Title::from(" Page ").alignment(Alignment::Right));
108+
.title_top(Line::from(" Page ").right_aligned());
109109
let row = Row::new(vec!["Run a query to generate results"]);
110110
let widths = vec![Constraint::Percentage(100)];
111111
let table = Table::new(vec![row], widths).block(block);

src/tui/ui/tabs/sql.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use ratatui::{
1919
buffer::Buffer,
2020
layout::{Alignment, Constraint, Direction, Layout, Rect},
2121
style::{palette::tailwind, Style, Stylize},
22-
text::Span,
23-
widgets::{block::Title, Block, Borders, Paragraph, Row, StatefulWidget, Table, Widget, Wrap},
22+
text::{Line, Span},
23+
widgets::{Block, Borders, Paragraph, Row, StatefulWidget, Table, Widget, Wrap},
2424
};
2525

2626
use crate::tui::App;
@@ -42,10 +42,10 @@ pub fn render_sql_editor(area: Rect, buf: &mut Buffer, app: &App) {
4242
vec![Span::from(" Editor ").fg(tailwind::WHITE)]
4343
};
4444
let mode_text = format!(" {:?} ", sql_tab.mode());
45-
let mode = Title::from(mode_text.as_str());
45+
let mode = Line::from(mode_text.as_str());
4646
let block = Block::default()
4747
.title(title)
48-
.title(mode.alignment(Alignment::Right))
48+
.title_top(mode.right_aligned())
4949
.borders(Borders::ALL)
5050
.fg(border_color);
5151
let mut editor = app.state.sql_tab.active_editor_cloned();
@@ -67,7 +67,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
6767
let block = Block::default()
6868
.title(" Results ")
6969
.borders(Borders::ALL)
70-
.title(Title::from(format!(" Page {p} ")).alignment(Alignment::Right));
70+
.title_top(Line::from(format!(" Page {p} ")).right_aligned());
7171
let batches = vec![batch];
7272
let maybe_table = record_batches_to_table(&batches);
7373

@@ -96,7 +96,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
9696
let block = Block::default()
9797
.title(" Results ")
9898
.borders(Borders::ALL)
99-
.title(Title::from(" Page ").alignment(Alignment::Right))
99+
.title_top(Line::from(" Page ").right_aligned())
100100
.title_bottom(format!(" {}ms ", dur));
101101
let p = Paragraph::new(e.error().to_string())
102102
.block(block)
@@ -107,7 +107,7 @@ pub fn render_sql_results(area: Rect, buf: &mut Buffer, app: &App) {
107107
let block = Block::default()
108108
.title(" Results ")
109109
.borders(Borders::ALL)
110-
.title(Title::from(" Page ").alignment(Alignment::Right));
110+
.title_top(Line::from(" Page ").right_aligned());
111111
let row = Row::new(vec!["Run a query to generate results"]);
112112
let widths = vec![Constraint::Percentage(100)];
113113
let table = Table::new(vec![row], widths).block(block);

0 commit comments

Comments
 (0)