diff --git a/src/modes/info.rs b/src/modes/info.rs index fdcbaf7..24850e3 100644 --- a/src/modes/info.rs +++ b/src/modes/info.rs @@ -9,7 +9,6 @@ use clap::error::ErrorKind; use std::path::PathBuf; use crate::services::item_service::ItemService; -use crate::modes::common::get_format_box_chars_no_border_line_separator; use chrono::prelude::*; use is_terminal::IsTerminal; use comfy_table::{Table, ContentArrangement, Cell, Attribute}; diff --git a/src/modes/list.rs b/src/modes/list.rs index b9cd71c..c0f56b4 100644 --- a/src/modes/list.rs +++ b/src/modes/list.rs @@ -145,10 +145,10 @@ pub fn mode_list( Cell::new(&string_column(item.id.unwrap_or(0).to_string(), column_width)); match column.align { crate::config::ColumnAlignment::Right => { - cell = cell.alignment(CellAlignment::Right); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell = cell.alignment(CellAlignment::Left); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -163,10 +163,10 @@ pub fn mode_list( )); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -180,10 +180,10 @@ pub fn mode_list( )); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -199,10 +199,10 @@ pub fn mode_list( }; match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -213,10 +213,10 @@ pub fn mode_list( Cell::new(&string_column(item.compression.to_string(), column_width)); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -230,10 +230,10 @@ pub fn mode_list( )); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -244,10 +244,10 @@ pub fn mode_list( .add_attribute(Attribute::Bold); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -260,10 +260,10 @@ pub fn mode_list( )); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -272,10 +272,10 @@ pub fn mode_list( let mut cell = Cell::new(&string_column(tags.join(" "), column_width)); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -287,10 +287,10 @@ pub fn mode_list( Cell::new(&string_column(meta_value.to_string(), column_width)); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -299,10 +299,10 @@ pub fn mode_list( let mut cell = Cell::new(""); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell @@ -312,10 +312,10 @@ pub fn mode_list( let mut cell = Cell::new(""); match column.align { crate::config::ColumnAlignment::Right => { - cell.align(Alignment::RIGHT); + cell = cell.set_alignment(CellAlignment::Right); } crate::config::ColumnAlignment::Left => { - cell.align(Alignment::LEFT); + cell = cell.set_alignment(CellAlignment::Left); } } cell diff --git a/src/modes/status.rs b/src/modes/status.rs index 1c27df7..5797486 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use std::str::FromStr; use log::debug; -use crate::modes::common::{get_format_box_chars_no_border_line_separator, OutputFormat}; +use crate::modes::common::OutputFormat; use crate::config; use crate::common::status::StatusInfo; use serde_json; diff --git a/src/modes/status_plugins.rs b/src/modes/status_plugins.rs index f4956c1..06d9f46 100644 --- a/src/modes/status_plugins.rs +++ b/src/modes/status_plugins.rs @@ -142,17 +142,14 @@ fn build_compression_table(compression_info: &Vec) -> Table { compression_table.add_row(vec![ info.compression_type.clone(), match info.found { - true => Cell::new("Yes").fg(Color::Green).to_string(), - false => Cell::new("No").fg(Color::Red).to_string(), + true => "Yes".to_string(), + false => "No".to_string(), }, match info.default { - true => Cell::new("Yes").fg(Color::Green).to_string(), - false => Cell::new("No").to_string(), - }, - match info.binary.as_str() { - "" => Cell::new(&info.binary).fg(Color::DarkGrey).to_string(), - _ => info.binary.clone(), + true => "Yes".to_string(), + false => "No".to_string(), }, + info.binary.clone(), info.compress.clone(), info.decompress.clone(), ]);