Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use consts as indexes or labels #170

Closed
KodrAus opened this issue Sep 29, 2023 · 0 comments · Fixed by #174
Closed

Can't use consts as indexes or labels #170

KodrAus opened this issue Sep 29, 2023 · 0 comments · Fixed by #174
Labels
bug Something isn't working

Comments

@KodrAus
Copy link
Collaborator

KodrAus commented Sep 29, 2023

The index and label attributes expect literal values, which means this doesn't work:

const INDEX: sval::Index = sval::Index::new(1).with_tag(..);

#[derive(Value)]
pub struct Data {
    #[sval(index = INDEX)]
    a: i32,
}
@KodrAus KodrAus added the bug Something isn't working label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant