alef-codegen 0.15.21

Shared codegen utilities for the alef polyglot binding generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
impl From<{{ core_path }}> for {{ binding_name }} {
    fn from(val: {{ core_path }}) -> Self {
        {%- if is_newtype %}
        Self { _0: {{ newtype_inner_expr }} }
        {%- else %}
        Self {
            {%- for field in fields %}
            {{ field }},
            {%- endfor %}
        }
        {%- endif %}
    }
}