Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli-table-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ doc = []

[dependencies]
proc-macro2 = "1.0.94"
syn = "2.0.100"
syn = "3.0"
quote = "1.0.40"

[lib]
Expand Down
10 changes: 5 additions & 5 deletions cli-table-derive/src/context/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Fields {
}
}

fields.sort_by(|left, right| left.order.cmp(&right.order));
fields.sort_by_key(|left| left.order);

Ok(Fields { fields })
}
Expand Down Expand Up @@ -147,10 +147,10 @@ impl Field {
}
}

if let Some(skip) = skip {
if skip.value {
return Ok(None);
}
if let Some(skip) = skip
&& skip.value
{
return Ok(None);
}

let mut field_builder = Self::builder(ident, span);
Expand Down
2 changes: 1 addition & 1 deletion cli-table-derive/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn get_attributes(attrs: &[Attribute]) -> Result<Vec<(Path, Lit)>> {
.ok()
.map(|v| v.parse())
.transpose()?
.unwrap_or(Lit::from(LitBool {
.unwrap_or(Lit::Bool(LitBool {
value: true,
span: path.span(),
}));
Expand Down
18 changes: 4 additions & 14 deletions cli-table/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,39 +211,29 @@ struct CellFormat {
}

/// Used to horizontally justify contents of a cell
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Default)]
pub enum Justify {
/// Justifies contents to left
#[default]
Left,
/// Justifies contents to right
Right,
/// Justifies contents to center
Center,
}

impl Default for Justify {
fn default() -> Self {
Self::Left
}
}

/// Used to vertically align contents of a cell
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Default)]
pub enum Align {
/// Aligns contents to top
#[default]
Top,
/// Aligns contents to bottom
Bottom,
/// Aligns contents to center
Center,
}

impl Default for Align {
fn default() -> Self {
Self::Top
}
}

/// Used to add padding to the contents of a cell
#[derive(Debug, Clone, Copy, Default)]
pub struct Padding {
Expand Down
2 changes: 1 addition & 1 deletion cli-table/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl RowStruct {
let cell_buffers = self
.cells
.iter()
.zip(available_cell_dimensions.into_iter())
.zip(available_cell_dimensions)
.map(|(cell, available_dimension)| cell.buffers(writer, available_dimension))
.collect::<Result<Vec<Vec<Buffer>>>>()?;

Expand Down
2 changes: 1 addition & 1 deletion cli-table/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl TableStruct {
if widths.is_empty() {
widths = new_widths;
} else {
for (width, new_width) in widths.iter_mut().zip(new_widths.into_iter()) {
for (width, new_width) in widths.iter_mut().zip(new_widths) {
*width = std::cmp::max(new_width, *width);
}
}
Expand Down
Loading