fix: Fix missing imports and type resolution issues
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
use humansize::{FormatSizeOptions, BINARY};
|
||||
use log::debug;
|
||||
use log::{debug, self};
|
||||
use prettytable::format::TableFormat; // Add missing import
|
||||
use regex::Regex;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use anyhow::anyhow;
|
||||
|
||||
pub fn get_meta_from_env() -> HashMap<String, String> {
|
||||
debug!("MAIN: Getting meta from KEEP_META_*");
|
||||
@@ -80,23 +81,8 @@ impl ColumnType {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&str> for ColumnType {
|
||||
type Error = anyhow::Error;
|
||||
|
||||
fn try_from(s: &str) -> Result<Self, Self::Error> {
|
||||
match s {
|
||||
"id" => Ok(ColumnType::Id),
|
||||
"time" => Ok(ColumnType::Time),
|
||||
"size" => Ok(ColumnType::Size),
|
||||
"compression" => Ok(ColumnType::Compression),
|
||||
"filesize" => Ok(ColumnType::FileSize),
|
||||
"filepath" => Ok(ColumnType::FilePath),
|
||||
"tags" => Ok(ColumnType::Tags),
|
||||
"meta" => Ok(ColumnType::Meta),
|
||||
_ => Err(anyhow!("Unknown column type: {}", s)),
|
||||
}
|
||||
}
|
||||
}
|
||||
// impl TryFrom<&str> for ColumnType is already implemented by strum_macros
|
||||
// so we remove this conflicting implementation
|
||||
|
||||
pub fn get_format_box_chars_no_border_line_separator() -> TableFormat {
|
||||
prettytable::format::FormatBuilder::new()
|
||||
|
||||
Reference in New Issue
Block a user