INNER CODE UNIT · Rust

from_str

informationsea/transanno · liftover-rs/src/chain/mod.rs:34

    fn from_str(s: &str) -> Result<Self, LiftOverError> {
        match s {
            "+" => Ok(Strand::Forward),
            "-" => Ok(Strand::Reverse),
            _ => Err(LiftOverError::ParseStrandError),
        }
    }
}

impl Display for Strand {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Strand::Forward => write!(f, "+"),
            Strand::Reverse => write!(f, "-"),
        }
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…