alef 0.109.6

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

fn {{ merge_fn }}(
    {% if has_fields %}target{% else %}_target{% endif %}: &mut {{ core_type }},
    {% if has_fields %}mut updated{% else %}_updated{% endif %}: {{ core_type }},
) {
{% for field in fields %}
{% if field.cfg %}
    #[cfg({{ field.cfg }})]
    {
        std::mem::swap(&mut target.{{ field.name }}, &mut updated.{{ field.name }});
    }
{% else %}
    std::mem::swap(&mut target.{{ field.name }}, &mut updated.{{ field.name }});
{% endif %}
{% endfor %}
}