feat: add ColumnType as_str method and improve error handling
This commit is contained in:
@@ -59,6 +59,22 @@ pub enum ColumnType {
|
||||
Meta,
|
||||
}
|
||||
|
||||
impl ColumnType {
|
||||
/// Returns the human-readable string representation of the column type
|
||||
pub fn as_str(&self) -> &str {
|
||||
match self {
|
||||
ColumnType::Id => "id",
|
||||
ColumnType::Time => "time",
|
||||
ColumnType::Size => "size",
|
||||
ColumnType::Compression => "compression",
|
||||
ColumnType::FileSize => "filesize",
|
||||
ColumnType::FilePath => "filepath",
|
||||
ColumnType::Tags => "tags",
|
||||
ColumnType::Meta => "meta",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_format_box_chars_no_border_line_separator() -> TableFormat {
|
||||
prettytable::format::FormatBuilder::new()
|
||||
.column_separator('│')
|
||||
|
||||
Reference in New Issue
Block a user