8000 Field attribute macro should contain its name · Issue #708 · extendr/extendr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Field attribute macro should contain its name #708
Open
@CGMossa

Description

@CGMossa

Looking at this example snippet

#[extendr(use_try_from = true)]
fn with_optional_input(#[default = "NULL"] idx : Nullable<Integers>) -> Integers {
    match idx {
        NotNull(x) => x,
        Null => (0..5).collect::<Integers>() /* do not remember the syntax */
    }
}

Source: extendr/extendr.github.io#27

Here #[extendr] macro has a field attribute that is not #[extendr(default = "NULL")].
I believe including the macro name in the attribute is standard practice, to avoid collisions with other macros.

See https://serde.rs/field-attrs.html as an example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0