fn convert_percentage(
    rawkeys: &HashMap<String, Vec<u8>>,
    label: &str,
) -> Result<Option<Percent>, VEError> {
    let raw = rawkeys
        .get(label)
        .ok_or_else(|| VEError::MissingField(label.into()))?;

    let s = from_utf8(raw).map_err(|e| {
        VEError::Parse(format!("Failed to parse {} from {:?} - {}", label, &raw, e))
    })?;
    if s == "---" {
        Ok(None)
    } else {
        Ok(Some(s.parse::<Percent>()? / 10.0))
    }
}
/// "When the BMV is not synchronised, these statistics have no meaning, so "---" will be sent instead of a value"
"When the BMV is not synchronised, these statistics have no meaning, so "---" will be sent instead of a value"
" When the BMV is not synchronised these statistics have no meaning so " --- " will be sent instead of a value "
fn convert_percentage(
    rawkeys: &HashMap<String, Vec<u8>>,
    label: &str,
) -> Result<Option<Percent>, VEError> {
    let raw = rawkeys
        .get(label)
        .ok_or_else(|| VEError::MissingField(label.into()))?;
    let s = from_utf8(raw).map_err(|e| {
        VEError::Parse(format!("Failed to parse {} from {:?} - {}", label, &raw, e))
    })?;
    if s == "---" {
        Ok(None)
    } else {
        Ok(Some(s.parse::<Percent>()? / 10.0))
    }
}
fn convert_percentage ( rawkeys : & HashMap < String , Vec < u8 > > , label : & str , ) -> Result < Option < Percent > , VEError > { let raw = rawkeys . get ( label ) . ok_or_else ( | | VEError :: MissingField ( label . into ( ) ) ) ? ; let s = from_utf8 ( raw ) . map_err ( | e | { VEError :: Parse ( format ! ( " " label raw e ) ) } ) ? ; if s == " " { Ok ( None ) } else { Ok ( Some ( s . parse :: < Percent > ( ) ? / 10.0 ) ) } }
"When the BMV is not synchronised, these statistics have no meaning, so "---" will be sent instead of a value"
" When the BMV is not synchronised these statistics have no meaning so " --- " will be sent instead of a value "
rawkeys
&HashMap<String, Vec<u8>>
label
&str
rawkeys
&HashMap<String, Vec<u8>>
label
&str