mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 21:27:45 +02:00
nu-table: Don't show empty header (#6035)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -19,9 +19,9 @@ use crate::{
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Table {
|
||||
pub headers: Option<Vec<StyledString>>,
|
||||
pub data: Vec<Vec<StyledString>>,
|
||||
pub theme: TableTheme,
|
||||
headers: Option<Vec<StyledString>>,
|
||||
data: Vec<Vec<StyledString>>,
|
||||
theme: TableTheme,
|
||||
}
|
||||
|
||||
impl Table {
|
||||
@ -30,6 +30,11 @@ impl Table {
|
||||
data: Vec<Vec<StyledString>>,
|
||||
theme: TableTheme,
|
||||
) -> Table {
|
||||
let headers = match headers {
|
||||
Some(headers) if headers.is_empty() => None,
|
||||
headers => headers,
|
||||
};
|
||||
|
||||
Table {
|
||||
headers,
|
||||
data,
|
||||
|
Reference in New Issue
Block a user