From 7cc4bb7eb147c4c7d2be6429013932151225703a Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Mon, 6 Sep 2021 16:09:09 +0900 Subject: [PATCH] fix table status --- src/components/table_status.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/table_status.rs b/src/components/table_status.rs index 7c0bee3..eebf268 100644 --- a/src/components/table_status.rs +++ b/src/components/table_status.rs @@ -45,20 +45,20 @@ impl TableStatusComponent { impl DrawableComponent for TableStatusComponent { fn draw(&mut self, f: &mut Frame, area: Rect, focused: bool) -> Result<()> { let status = Paragraph::new(Spans::from(vec![ - Span::from("rows: "), Span::from(format!( - "{}, ", + "rows: {}, ", self.row_count.map_or("-".to_string(), |c| c.to_string()) )), - Span::from("columns: "), Span::from(format!( - "{}, ", + "columns: {}, ", self.column_count.map_or("-".to_string(), |c| c.to_string()) )), - Span::from("engine: "), - Span::from(self.table.as_ref().map_or("-".to_string(), |c| { - c.engine.as_ref().map_or("-".to_string(), |e| e.to_string()) - })), + Span::from(format!( + "engine: {}", + self.table.as_ref().map_or("-".to_string(), |c| { + c.engine.as_ref().map_or("-".to_string(), |e| e.to_string()) + }) + )), ])) .block(Block::default().borders(Borders::TOP).style(if focused { Style::default()