Inline utils::whitespace
This commit is contained in:
parent
83f6e6e43e
commit
f5e5c01697
2 changed files with 5 additions and 7 deletions
|
@ -25,7 +25,6 @@ use crate::{
|
||||||
constants::{BOLD, BOLD_YELLOW, RESET, YELLOW},
|
constants::{BOLD, BOLD_YELLOW, RESET, YELLOW},
|
||||||
err,
|
err,
|
||||||
impl_error,
|
impl_error,
|
||||||
utils::whitespace,
|
|
||||||
Error,
|
Error,
|
||||||
ErrorTrait,
|
ErrorTrait,
|
||||||
};
|
};
|
||||||
|
@ -100,7 +99,7 @@ impl<'a> Table<'a> {
|
||||||
marker: Vec::new(),
|
marker: Vec::new(),
|
||||||
column_attr: Vec::new(),
|
column_attr: Vec::new(),
|
||||||
width_max: width,
|
width_max: width,
|
||||||
whitespace: whitespace(width),
|
whitespace: " ".repeat(width),
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
dimensions: (0, 0),
|
dimensions: (0, 0),
|
||||||
built: false,
|
built: false,
|
||||||
|
@ -322,7 +321,7 @@ mod test {
|
||||||
marker: Vec::new(),
|
marker: Vec::new(),
|
||||||
column_attr: Vec::new(),
|
column_attr: Vec::new(),
|
||||||
width_max: 80,
|
width_max: 80,
|
||||||
whitespace: whitespace(80),
|
whitespace: " ".repeat(80),
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
dimensions: (0, 0),
|
dimensions: (0, 0),
|
||||||
built: false,
|
built: false,
|
||||||
|
|
|
@ -33,7 +33,6 @@ use pacwrap_core::{
|
||||||
utils::{
|
utils::{
|
||||||
arguments::Operand,
|
arguments::Operand,
|
||||||
table::{ColumnAttribute, Table},
|
table::{ColumnAttribute, Table},
|
||||||
whitespace,
|
|
||||||
Arguments,
|
Arguments,
|
||||||
},
|
},
|
||||||
ErrorGeneric,
|
ErrorGeneric,
|
||||||
|
@ -209,15 +208,15 @@ pub fn list_containers(args: &mut Arguments) -> Result<()> {
|
||||||
println!(
|
println!(
|
||||||
"{}\nTotal Size: {}{} \nDifference: {}{} - {} {} \n{}Size on Disk{}: {}{}\n",
|
"{}\nTotal Size: {}{} \nDifference: {}{} - {} {} \n{}Size on Disk{}: {}{}\n",
|
||||||
table.build()?,
|
table.build()?,
|
||||||
whitespace(max_len - equation[0].len()),
|
" ".repeat(max_len - equation[0].len()),
|
||||||
equation[0],
|
equation[0],
|
||||||
*UNDERLINE,
|
*UNDERLINE,
|
||||||
whitespace(max_len - equation[1].len()),
|
" ".repeat(max_len - equation[1].len()),
|
||||||
equation[1],
|
equation[1],
|
||||||
*RESET,
|
*RESET,
|
||||||
*BOLD,
|
*BOLD,
|
||||||
*RESET,
|
*RESET,
|
||||||
whitespace(max_len - equation[2].len()),
|
" ".repeat(max_len - equation[2].len()),
|
||||||
equation[2]
|
equation[2]
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue