Skip to content

Commit

Permalink
refactor(ast): implement same traits on all fieldless enums (#3031)
Browse files Browse the repository at this point in the history
Implement same traits on all AST fieldless enums, for consistency. Just
a little bit of tidying.
  • Loading branch information
overlookmotel authored Apr 19, 2024
1 parent 280441f commit 1249c6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ pub struct TSTypeOperator<'a> {
pub type_annotation: TSType<'a>,
}

#[derive(Debug, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(Serialize, Tsify))]
#[cfg_attr(feature = "serialize", serde(rename_all = "lowercase"))]
pub enum TSTypeOperatorOperator {
Expand Down Expand Up @@ -520,7 +520,7 @@ pub struct TSTypeAliasDeclaration<'a> {
pub modifiers: Modifiers<'a>,
}

#[derive(Debug, Hash, Clone, PartialEq, Eq, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(Serialize, Tsify))]
#[cfg_attr(feature = "serialize", serde(rename_all = "lowercase"))]
pub enum TSAccessibility {
Expand Down Expand Up @@ -612,7 +612,7 @@ pub struct TSCallSignatureDeclaration<'a> {
pub type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
}

#[derive(Debug, Clone, Copy, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(Serialize, Tsify))]
#[cfg_attr(feature = "serialize", serde(rename_all = "lowercase"))]
pub enum TSMethodSignatureKind {
Expand Down Expand Up @@ -867,7 +867,7 @@ pub struct TSMappedType<'a> {
pub readonly: TSMappedTypeModifierOperator,
}

#[derive(Debug, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(Serialize, Tsify))]
#[cfg_attr(feature = "serialize", serde(rename_all = "camelCase"))]
pub enum TSMappedTypeModifierOperator {
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub mod scope;
pub mod symbol;
pub mod xml_entities;

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum NumberBase {
Float,
Decimal,
Expand All @@ -27,7 +27,7 @@ impl NumberBase {
}
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum BigintBase {
Decimal,
Binary,
Expand Down

0 comments on commit 1249c6c

Please sign in to comment.