From 94c0ddf82bc944bf552af9cf2729c7019a3c8d70 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Mon, 14 Sep 2026 15:31:59 +0900 Subject: [PATCH 1/2] chore: bump syn to 3.0 --- cli-table-derive/Cargo.toml | 2 +- cli-table-derive/src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli-table-derive/Cargo.toml b/cli-table-derive/Cargo.toml index 1d84103..596e4ff 100644 --- a/cli-table-derive/Cargo.toml +++ b/cli-table-derive/Cargo.toml @@ -20,7 +20,7 @@ doc = [] [dependencies] proc-macro2 = "1.0.94" -syn = "2.0.100" +syn = "3.0" quote = "1.0.40" [lib] diff --git a/cli-table-derive/src/utils.rs b/cli-table-derive/src/utils.rs index 58a573d..3938905 100644 --- a/cli-table-derive/src/utils.rs +++ b/cli-table-derive/src/utils.rs @@ -16,7 +16,7 @@ pub fn get_attributes(attrs: &[Attribute]) -> Result> { .ok() .map(|v| v.parse()) .transpose()? - .unwrap_or(Lit::from(LitBool { + .unwrap_or(Lit::Bool(LitBool { value: true, span: path.span(), })); From 8ddd6f0ddf999ed3cf70543ff2d4a68a99bd70c6 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Thu, 17 Sep 2026 10:54:15 +0900 Subject: [PATCH 2/2] chore: clippy fix with new rust --- cli-table-derive/src/context/fields.rs | 10 +++++----- cli-table/src/cell.rs | 18 ++++-------------- cli-table/src/row.rs | 2 +- cli-table/src/table.rs | 2 +- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/cli-table-derive/src/context/fields.rs b/cli-table-derive/src/context/fields.rs index 4989082..4a34f28 100644 --- a/cli-table-derive/src/context/fields.rs +++ b/cli-table-derive/src/context/fields.rs @@ -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 }) } @@ -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); diff --git a/cli-table/src/cell.rs b/cli-table/src/cell.rs index f3ff1bc..0588134 100644 --- a/cli-table/src/cell.rs +++ b/cli-table/src/cell.rs @@ -211,9 +211,10 @@ 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, @@ -221,16 +222,11 @@ pub enum Justify { 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, @@ -238,12 +234,6 @@ pub enum Align { 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 { diff --git a/cli-table/src/row.rs b/cli-table/src/row.rs index 67bb126..e84a8fe 100644 --- a/cli-table/src/row.rs +++ b/cli-table/src/row.rs @@ -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::>>>()?; diff --git a/cli-table/src/table.rs b/cli-table/src/table.rs index 14d1163..f437adf 100644 --- a/cli-table/src/table.rs +++ b/cli-table/src/table.rs @@ -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); } }