pub fn parse_check_conversion_map(
    types: &HashMap<Atom, String>,
    names: &Vec<Atom>,
) -> Result<HashMap<Atom, Conversion>, ConversionError> {
    // Check if any named type references a nonexistent field
    let names: HashSet<Atom> = names.into_iter().map(|s| s.into()).collect();
    for (name, _) in types {
        if !names.contains(name) {
            warn!(
                message = "Field was specified in the types but is not a valid field name.",
                field = &name[..]
            );
        }
    }

    parse_conversion_map(types)
}
/// Helper function to parse a conversion map and check against a list of names
Helper function to parse a conversion map and check against a list of names
Helper function to parse a conversion map and check against a list of names
pub fn parse_check_conversion_map(
    types: &HashMap<Atom, String>,
    names: &Vec<Atom>,
) -> Result<HashMap<Atom, Conversion>, ConversionError> {
    // Check if any named type references a nonexistent field
    let names: HashSet<Atom> = names.into_iter().map(|s| s.into()).collect();
    for (name, _) in types {
        if !names.contains(name) {
            warn!(
                message = "Field was specified in the types but is not a valid field name.",
                field = &name[..]
            );
        }
    }
    parse_conversion_map(types)
}
pub fn parse_check_conversion_map ( types : & HashMap < Atom , String > , names : & Vec < Atom > , ) -> Result < HashMap < Atom , Conversion > , ConversionError > { // Check if any named type references a nonexistent field let names : HashSet < Atom > = names . into_iter ( ) . map ( | s | s . into ( ) ) . collect ( ) ; for ( name , _ ) in types { if ! names . contains ( name ) { warn ! ( message " " field name [ ] ) ; } } parse_conversion_map ( types ) }
Helper function to parse a conversion map and check against a list of names
Helper function to parse a conversion map and check against a list of names
types
&HashMap<Atom, String>
names
&Vec<Atom>