Skip to content

Commit

Permalink
fix: dataset has no ID anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Sep 6, 2023
1 parent 7629ac3 commit c6d7381
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/dsp_meta/domain/dataset.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::domain::{Title, ID};
use crate::domain::Title;
use crate::errors::DspMetaError;

#[derive(Debug, PartialEq)]
pub struct Dataset {
pub id: ID,
pub title: Title,
}

Expand All @@ -17,12 +16,7 @@ impl TryFrom<&hcl::Block> for Dataset {
));
}

let dataset_label = dataset_block.labels().first().ok_or_else(|| {
DspMetaError::ParseDataset("Parse error: dataset needs to have one label.")
})?;
let id = ID(dataset_label.as_str().to_string());

let title = Title(String::from("TODO: implement title extraction"));
Ok(Self { id, title })
Ok(Self { title })
}
}

0 comments on commit c6d7381

Please sign in to comment.