fn parse_number(name: &String, num: &serde_json::Number) -> Result<Property, Error> {
    if num.is_i64() {
        Ok(Property::Int(name.to_string(), num.as_i64().unwrap()))
    } else if num.is_u64() {
        Ok(Property::Uint(name.to_string(), num.as_u64().unwrap()))
    } else if num.is_f64() {
        Ok(Property::Double(name.to_string(), num.as_f64().unwrap()))
    } else {
        bail!("Diagnostics numbers must fit within 64 bits.")
    }
}
/// Parses a serde_json Number into an Inspect number Property.
Parses a serde_json Number into an Inspect number Property.
Parses a serde_json Number into an Inspect number Property .
fn parse_number(name: &String, num: &serde_json::Number) -> Result<Property, Error> {
    if num.is_i64() {
        Ok(Property::Int(name.to_string(), num.as_i64().unwrap()))
    } else if num.is_u64() {
        Ok(Property::Uint(name.to_string(), num.as_u64().unwrap()))
    } else if num.is_f64() {
        Ok(Property::Double(name.to_string(), num.as_f64().unwrap()))
    } else {
        bail!("Diagnostics numbers must fit within 64 bits.")
    }
}
fn parse_number ( name : & String , num : & serde_json :: Number ) -> Result < Property , Error > { if num . is_i64 ( ) { Ok ( Property :: Int ( name . to_string ( ) , num . as_i64 ( ) . unwrap ( ) ) ) } else if num . is_u64 ( ) { Ok ( Property :: Uint ( name . to_string ( ) , num . as_u64 ( ) . unwrap ( ) ) ) } else if num . is_f64 ( ) { Ok ( Property :: Double ( name . to_string ( ) , num . as_f64 ( ) . unwrap ( ) ) ) } else { bail ! ( " " ) } }
Parses a serde_json Number into an Inspect number Property.
Parses a serde_json Number into an Inspect number Property .
name
&String
num
&serde_json::Number