alef-codegen 0.15.39

Shared codegen utilities for the alef polyglot binding generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Return the error code string for a `{{ rust_path }}` variant.
#[allow(dead_code)]
fn {{ code_fn_name }}(e: &{{ rust_path }}) -> &'static str {
    #[allow(unreachable_patterns)]
    match e {
{%- for pattern, code in variants %}
        {{ pattern }} => "{{ code }}",
{%- endfor %}
        _ => "{{ default_code }}",
    }
}