Skip to content

Commit

Permalink
settings: default serde serialization/deserialization to use kebab-ca…
Browse files Browse the repository at this point in the history
…se for enums
  • Loading branch information
feds01 committed Jul 10, 2024
1 parent 8aad0c1 commit 277c168
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/hash-pipeline/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl Default for CompilerSettings {
Serialize,
JsonSchema,
)]
#[serde(crate = "self::serde")]
#[serde(crate = "self::serde", rename_all = "kebab-case")]
pub enum OptimisationLevel {
/// Run the compiler using the debug optimisation level. This will
/// disable most optimisations that the compiler would otherwise do.
Expand Down Expand Up @@ -687,7 +687,7 @@ impl Default for CodeGenSettings {
/// All of the current possible code generation backends that
/// are available.
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Serialize, Deserialize, JsonSchema)]
#[serde(crate = "self::serde")]
#[serde(crate = "self::serde", rename_all = "kebab-case")]
pub enum CodeGenBackend {
/// The LLVM backend is target for code generation.
#[cfg(feature = "llvm")]
Expand Down Expand Up @@ -756,7 +756,7 @@ impl fmt::Display for CodeGenBackend {
Serialize,
JsonSchema,
)]
#[serde(crate = "self::serde")]
#[serde(crate = "self::serde", rename_all = "kebab-case")]
pub enum CompilerStageKind {
/// Parse the source code into an AST.
Parse,
Expand Down
1 change: 1 addition & 0 deletions compiler/hash-utils/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::{
#[derive(
ValueEnum, Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, JsonSchema, Default,
)]
#[serde(rename_all = "lowercase")]
pub enum CompilerMessagingFormat {
/// All messages that are emitted to and from the compiler will be in JSON
/// format according to the schema that represents [CompilerMessage].
Expand Down

0 comments on commit 277c168

Please sign in to comment.