Skip to content

Commit

Permalink
chore: use serde(rename_all = "kebab-case") where appropriate (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakibaki committed Jun 26, 2024
1 parent 41b971d commit 9170afe
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/seqvars/query/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ use crate::common::genotype_to_string;
#[derive(
serde::Serialize, serde::Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy,
)]
#[serde(rename_all = "kebab-case")]
pub enum RecessiveMode {
/// Recessive.
#[serde(rename = "recessive")]
Recessive,
/// Compound recessive.
#[serde(rename = "compound-recessive")]
CompoundRecessive,
}

Expand All @@ -31,16 +30,15 @@ pub enum RecessiveMode {
Copy,
Default,
)]
#[serde(rename_all = "kebab-case")]
pub enum FailChoice {
/// Ignore failure.
#[default]
#[serde(rename = "ignore")]
Ignore,
/// Drop whole variant.
#[serde(rename = "drop-variant")]
Drop,
/// Interpret as "no-call".
#[serde(rename = "no-call")]
NoCall,
}

Expand All @@ -58,34 +56,26 @@ pub enum FailChoice {
Copy,
Default,
)]
#[serde(rename_all = "kebab-case")]
pub enum GenotypeChoice {
/// Any genotype.
#[default]
#[serde(rename = "any")]
Any,
/// Ref. genotype.
#[serde(rename = "ref")]
Ref,
/// Het. genotype.
#[serde(rename = "het")]
Het,
/// Hom. genotype.
#[serde(rename = "hom")]
Hom,
/// Non-hom. genotype.
#[serde(rename = "non-hom")]
NonHom,
/// Variant genotype.
#[serde(rename = "variant")]
Variant,
/// Index in comp. het. recessive inheritance.
#[serde(rename = "comphet-index")]
ComphetIndex,
/// Index in recessive inheritance.
#[serde(rename = "recessive-index")]
RecessiveIndex,
/// Parent in recessive inheritance.
#[serde(rename = "recessive-parent")]
RecessiveParent,
}

Expand Down

0 comments on commit 9170afe

Please sign in to comment.