-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert all remaining enums to use strum
- Loading branch information
1 parent
0ac0dea
commit 6c2ae78
Showing
13 changed files
with
181 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
use strum::{Display, IntoStaticStr}; | ||
|
||
/// FunctionParameterMode : The mode of the function parameter. | ||
/// The mode of the function parameter. | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
#[derive( | ||
Clone, | ||
Copy, | ||
Debug, | ||
Eq, | ||
PartialEq, | ||
Ord, | ||
PartialOrd, | ||
Hash, | ||
Serialize, | ||
Deserialize, | ||
IntoStaticStr, | ||
Display, | ||
)] | ||
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")] | ||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | ||
pub enum FunctionParameterMode { | ||
#[serde(rename = "IN")] | ||
In, | ||
} | ||
|
||
impl std::fmt::Display for FunctionParameterMode { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
match self { | ||
Self::In => write!(f, "IN"), | ||
} | ||
} | ||
} | ||
|
||
impl Default for FunctionParameterMode { | ||
fn default() -> FunctionParameterMode { | ||
Self::In | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
use strum::{Display, IntoStaticStr}; | ||
|
||
/// FunctionParameterType : The type of function parameter. | ||
/// The type of function parameter. | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
#[derive( | ||
Clone, | ||
Copy, | ||
Debug, | ||
Eq, | ||
PartialEq, | ||
Ord, | ||
PartialOrd, | ||
Hash, | ||
Serialize, | ||
Deserialize, | ||
IntoStaticStr, | ||
Display, | ||
)] | ||
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")] | ||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | ||
pub enum FunctionParameterType { | ||
#[serde(rename = "PARAM")] | ||
Param, | ||
#[serde(rename = "COLUMN")] | ||
Column, | ||
} | ||
|
||
impl std::fmt::Display for FunctionParameterType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
match self { | ||
Self::Param => write!(f, "PARAM"), | ||
Self::Column => write!(f, "COLUMN"), | ||
} | ||
} | ||
} | ||
|
||
impl Default for FunctionParameterType { | ||
fn default() -> FunctionParameterType { | ||
Self::Param | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
use strum::{Display, IntoStaticStr}; | ||
|
||
#[allow(clippy::empty_docs)] | ||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
#[derive( | ||
Clone, | ||
Copy, | ||
Debug, | ||
Eq, | ||
PartialEq, | ||
Ord, | ||
PartialOrd, | ||
Hash, | ||
Serialize, | ||
Deserialize, | ||
IntoStaticStr, | ||
Display, | ||
)] | ||
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")] | ||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | ||
pub enum TableOperation { | ||
#[serde(rename = "UNKNOWN_TABLE_OPERATION")] | ||
UnknownTableOperation, | ||
#[serde(rename = "READ")] | ||
Read, | ||
#[serde(rename = "READ_WRITE")] | ||
ReadWrite, | ||
} | ||
|
||
impl std::fmt::Display for TableOperation { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
match self { | ||
Self::UnknownTableOperation => write!(f, "UNKNOWN_TABLE_OPERATION"), | ||
Self::Read => write!(f, "READ"), | ||
Self::ReadWrite => write!(f, "READ_WRITE"), | ||
} | ||
} | ||
} | ||
|
||
impl Default for TableOperation { | ||
fn default() -> TableOperation { | ||
Self::UnknownTableOperation | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
use strum::{Display, IntoStaticStr}; | ||
|
||
#[allow(clippy::empty_docs)] | ||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
#[derive( | ||
Clone, | ||
Copy, | ||
Debug, | ||
Eq, | ||
PartialEq, | ||
Ord, | ||
PartialOrd, | ||
Hash, | ||
Serialize, | ||
Deserialize, | ||
IntoStaticStr, | ||
Display, | ||
)] | ||
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")] | ||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | ||
pub enum TableType { | ||
#[serde(rename = "MANAGED")] | ||
Managed, | ||
#[serde(rename = "EXTERNAL")] | ||
External, | ||
} | ||
|
||
impl std::fmt::Display for TableType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
match self { | ||
Self::Managed => write!(f, "MANAGED"), | ||
Self::External => write!(f, "EXTERNAL"), | ||
} | ||
} | ||
} | ||
|
||
impl Default for TableType { | ||
fn default() -> TableType { | ||
Self::Managed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.