alef-codegen 0.15.21

Shared codegen utilities for the alef polyglot binding generator
Documentation
{%- if has_stripped_cfg_fields %}
#[allow(clippy::needless_update)]
{%- endif %}
{%- if uses_builder_pattern %}
#[allow(clippy::field_reassign_with_default, clippy::let_and_return)]
{%- endif %}
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
impl From<{{ binding_name }}> for {{ core_path }} {
    fn from(val: {{ binding_name }}) -> Self {
        {%- if is_newtype %}
        Self({{ newtype_inner_expr }})
        {%- elif builder_mode %}
        let mut __result = {{ core_path }}::default();
        {%- for statement in statements %}
        {{ statement }}
        {%- endfor %}
        __result
        {%- else %}
        Self {
            {%- for field in fields %}
            {{ field }},
            {%- endfor %}
            {%- if has_stripped_cfg_fields %}
            ..Default::default()
            {%- endif %}
        }
        {%- endif %}
    }
}