Skip to content

Form derivation macros insists on string literals. #490

Closed
@horned-sphere

Description

@horned-sphere

Describe the bug
When using the Form derivation macro and specifying field names/enumeration tags etc, for example:

pub enum Envelope {
    #[form(tag = "auth")]
    Auth {
        #[form(body)]
        body: Option<Value>,
    },
    ...
}

the macro will only work if them name is a literal. If a constant is specified:

const AUTH: &str = "auth";
pub enum Envelope {
    #[form(tag = AUTH)]
    Auth {
        #[form(body)]
        body: Option<Value>,
    },
    ...
}

a compiler error is produced.

Expected behavior
The macro should accept a path to a constant string in addition to a literal.

Metadata

Metadata

Labels

bugSomething isn't workingformRelated to Recon forms.macros

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions