diff --git a/src/genes/cli/data.rs b/src/genes/cli/data.rs index 7c4c7dcf..4bff023d 100644 --- a/src/genes/cli/data.rs +++ b/src/genes/cli/data.rs @@ -1363,9 +1363,9 @@ pub mod hgnc { Withdrawn, } - impl Into for Status { - fn into(self) -> pbs::genes::base::HgncStatus { - match self { + impl From 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, } diff --git a/src/regions/cli/import.rs b/src/regions/cli/import.rs index 26966c75..b657ea9e 100644 --- a/src/regions/cli/import.rs +++ b/src/regions/cli/import.rs @@ -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 { @@ -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::::into( + haploinsufficiency_score, + ) as i32, + triplosensitivity_score: Into::::into( + triplosensitivity_score, + ) as i32, haploinsufficiency_disease_id, triplosensitivity_disease_id, };