Skip to content

Commit

Permalink
fix: another issue in enum protobuf conversion (with regions) (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Nov 24, 2023
1 parent 517ba37 commit aeeace3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/genes/cli/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,9 +1363,9 @@ pub mod hgnc {
Withdrawn,
}

impl Into<pbs::genes::base::HgncStatus> for Status {
fn into(self) -> pbs::genes::base::HgncStatus {
match self {
impl From<Status> for pbs::genes::base::HgncStatus {
fn from(val: Status) -> Self {
match val {
Status::Approve => pbs::genes::base::HgncStatus::Approved,
Status::Withdrawn => pbs::genes::base::HgncStatus::Withdrawn,
}
Expand Down
10 changes: 7 additions & 3 deletions src/regions/cli/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::Arc;
use clap::Parser;
use prost::Message;

use crate::{common, genes::cli::data::clingen_gene};
use crate::{common, genes::cli::data::clingen_gene, pbs};

/// Helper data structures for reading CSV files.
pub mod clingen {
Expand Down Expand Up @@ -178,8 +178,12 @@ fn tsv_import(
isca_id,
isca_region_name,
genomic_location,
haploinsufficiency_score: haploinsufficiency_score as i32,
triplosensitivity_score: triplosensitivity_score as i32,
haploinsufficiency_score: Into::<pbs::genes::base::ClingenDosageScore>::into(
haploinsufficiency_score,
) as i32,
triplosensitivity_score: Into::<pbs::genes::base::ClingenDosageScore>::into(
triplosensitivity_score,
) as i32,
haploinsufficiency_disease_id,
triplosensitivity_disease_id,
};
Expand Down

0 comments on commit aeeace3

Please sign in to comment.