Skip to content

Commit

Permalink
chore(ktf): use enum for KtfInputData
Browse files Browse the repository at this point in the history
  • Loading branch information
keesvv committed Aug 16, 2022
1 parent 08c3033 commit cf24913
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions convert/src/input/ktf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ impl KtfInput {
}

#[derive(Debug, Deserialize)]
pub struct KtfInputData {
pub col1: f32,
pub col2: f32,
pub col3: f32,
pub col4: String,
#[serde(tag = "type", rename_all = "camelCase")]
pub enum KtfInputData {
Test(TestData),
}

#[derive(Debug, Deserialize)]
pub struct TestData {
pub a: i32,
pub b: i32,
}

impl Input for KtfInput {
Expand Down

0 comments on commit cf24913

Please sign in to comment.