impl From<{{ core_path }}> for {{ binding_name }} {
    fn from(val: {{ core_path }}) -> Self {
        match val {
{%- for arm_info in arms %}
{%- if arm_info.cfg %}
            #[cfg({{ arm_info.cfg }})]
{%- endif %}
            {{ arm_info.arm }}
{%- endfor %}
{%- if has_excluded_variants %}
            _ => Default::default(),
{%- endif %}
        }
    }
}
