feat: add ColumnType as_str method and improve error handling
This commit is contained in:
@@ -69,8 +69,9 @@ pub fn mode_list(
|
||||
for column in list_format.clone() {
|
||||
let mut column_format = column.split(":").into_iter();
|
||||
let column_name = column_format.next().expect("Unable to parse column name");
|
||||
let column_type = ColumnType::from_str(column_name)
|
||||
.expect(format!("Unknown column {:?}", column_name).as_str());
|
||||
let column_type = ColumnType::from_str(column_name).map_err(|_| {
|
||||
anyhow!("Unknown column {:?}", column_name)
|
||||
})?;
|
||||
|
||||
if column_type == ColumnType::Meta {
|
||||
let meta_name = column_format
|
||||
|
||||
Reference in New Issue
Block a user