Skip to content

Commit 44c4023

Browse files
Added missing Copy derives (#2158)
1 parent aa5c6b3 commit 44c4023

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

src/ast/comments.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use core::{
2525
use crate::tokenizer::{Location, Span};
2626

2727
/// An opaque container for comments from a parse SQL source code.
28-
#[derive(Default, Debug)]
28+
#[derive(Default, Debug, Clone)]
2929
pub struct Comments(Vec<CommentWithSpan>);
3030

3131
impl Comments {
@@ -151,7 +151,7 @@ impl From<Comments> for Vec<CommentWithSpan> {
151151
}
152152

153153
/// A source code comment with information of its entire span.
154-
#[derive(Debug, Clone, PartialEq, Eq)]
154+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
155155
pub struct CommentWithSpan {
156156
/// The source code comment iself
157157
pub comment: Comment,
@@ -168,7 +168,7 @@ impl Deref for CommentWithSpan {
168168
}
169169

170170
/// A unified type of the different source code comment formats.
171-
#[derive(Debug, Clone, PartialEq, Eq)]
171+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
172172
pub enum Comment {
173173
/// A single line comment, typically introduced with a prefix and spanning
174174
/// until end-of-line or end-of-file in the source code.

src/ast/data_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ fn format_clickhouse_datetime_precision_and_timezone(
894894
}
895895

896896
/// Type of brackets used for `STRUCT` literals.
897-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
897+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
898898
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
899899
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
900900
pub enum StructBracketKind {

src/ast/ddl.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ impl fmt::Display for AlterPolicyOperation {
570570
/// [MySQL] `ALTER TABLE` algorithm.
571571
///
572572
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html
573-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
573+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
574574
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575575
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
576576
/// Algorithm option for `ALTER TABLE` operations (MySQL-specific).
@@ -599,7 +599,7 @@ impl fmt::Display for AlterTableAlgorithm {
599599
/// [MySQL] `ALTER TABLE` lock.
600600
///
601601
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html
602-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
602+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
603603
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
604604
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
605605
/// Locking behavior for `ALTER TABLE` (MySQL-specific).
@@ -1445,7 +1445,7 @@ impl fmt::Display for IndexOption {
14451445
/// [PostgreSQL] unique index nulls handling option: `[ NULLS [ NOT ] DISTINCT ]`
14461446
///
14471447
/// [PostgreSQL]: https://www.postgresql.org/docs/17/sql-altertable.html
1448-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1448+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
14491449
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14501450
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
14511451
pub enum NullsDistinctOption {
@@ -1756,7 +1756,7 @@ pub struct IdentityParameters {
17561756
/// ORDER | NOORDER
17571757
/// ```
17581758
/// [Snowflake]: https://docs.snowflake.com/en/sql-reference/sql/create-table
1759-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1759+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
17601760
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17611761
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
17621762
pub enum IdentityPropertyOrder {
@@ -2128,7 +2128,7 @@ impl fmt::Display for ColumnOption {
21282128

21292129
/// `GeneratedAs`s are modifiers that follow a column option in a `generated`.
21302130
/// 'ExpStored' is used for a column generated from an expression and stored.
2131-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
2131+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
21322132
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21332133
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
21342134
pub enum GeneratedAs {
@@ -2142,7 +2142,7 @@ pub enum GeneratedAs {
21422142

21432143
/// `GeneratedExpressionMode`s are modifiers that follow an expression in a `generated`.
21442144
/// No modifier is typically the same as Virtual.
2145-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
2145+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
21462146
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21472147
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
21482148
pub enum GeneratedExpressionMode {
@@ -3799,7 +3799,7 @@ impl Spanned for RenameTableNameKind {
37993799
}
38003800
}
38013801

3802-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
3802+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
38033803
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38043804
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
38053805
/// Whether the syntax used for the trigger object (ROW or STATEMENT) is `FOR` or `FOR EACH`.

src/ast/dml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl Display for MergeClause {
401401
/// ```
402402
/// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/merge)
403403
/// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#merge_statement)
404-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
404+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
405405
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406406
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
407407
pub enum MergeClauseKind {

src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8526,7 +8526,7 @@ impl fmt::Display for TableOptionsClustered {
85268526
}
85278527

85288528
/// Specifies which partition the boundary values on table partitioning belongs to.
8529-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
8529+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
85308530
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
85318531
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
85328532
pub enum PartitionRangeDirection {

src/ast/query.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl fmt::Display for Table {
322322
}
323323

324324
/// What did this select look like?
325-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
325+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
326326
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
327327
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
328328
pub enum SelectFlavor {
@@ -649,7 +649,7 @@ impl fmt::Display for With {
649649
}
650650
}
651651

652-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
652+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
653653
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
654654
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
655655
/// Indicates whether a CTE is materialized or not.
@@ -1185,7 +1185,7 @@ pub struct TableFunctionArgs {
11851185
pub settings: Option<Vec<Setting>>,
11861186
}
11871187

1188-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1188+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
11891189
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11901190
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
11911191
/// Type of index hint (e.g., `USE`, `IGNORE`, `FORCE`).
@@ -1208,7 +1208,7 @@ impl fmt::Display for TableIndexHintType {
12081208
}
12091209
}
12101210

1211-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1211+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
12121212
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12131213
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
12141214
/// The kind of index referenced by an index hint (e.g. `USE INDEX`).
@@ -1228,7 +1228,7 @@ impl fmt::Display for TableIndexType {
12281228
}
12291229
}
12301230

1231-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1231+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
12321232
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12331233
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
12341234
/// Which clause the table index hint applies to.
@@ -1579,7 +1579,7 @@ pub struct TableSample {
15791579
pub offset: Option<Expr>,
15801580
}
15811581

1582-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1582+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
15831583
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15841584
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
15851585
/// Modifier specifying whether `SAMPLE` or `TABLESAMPLE` keyword was used.
@@ -1630,7 +1630,7 @@ impl fmt::Display for TableSampleQuantity {
16301630
}
16311631

16321632
/// The table sample method names
1633-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1633+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
16341634
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16351635
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
16361636
/// Sampling method used by `TABLESAMPLE`.
@@ -1674,7 +1674,7 @@ impl fmt::Display for TableSampleSeed {
16741674
}
16751675
}
16761676

1677-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1677+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
16781678
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16791679
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
16801680
/// Modifier specifying how the sample seed is applied.
@@ -1694,7 +1694,7 @@ impl fmt::Display for TableSampleSeedModifier {
16941694
}
16951695
}
16961696

1697-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1697+
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
16981698
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16991699
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
17001700
/// Unit used with a `TABLESAMPLE` quantity (rows or percent).

src/ast/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl fmt::Display for DateTimeField {
484484
}
485485
}
486486

487-
#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash)]
487+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
488488
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
489489
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
490490
/// The Unicode Standard defines four normalization forms, which are intended to eliminate

0 commit comments

Comments
 (0)