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 raw Vec for config #39

Open
jamessewell opened this issue May 31, 2019 · 2 comments
Open

Can't use raw Vec for config #39

jamessewell opened this issue May 31, 2019 · 2 comments

Comments

@jamessewell
Copy link

Hi,

I want to use Vec<MetricGroups> as my config file format - but it doesn't seem to work.

Is this a supported feature?

When I use a Vec<String> I get the same issue, but if I wrap it in a struct like so:

struct Config {
   string: Vec<String>
}

Then I have no issue.

@vorner
Copy link
Owner

vorner commented May 31, 2019

Hello

Honestly, it seems unusual and it never crossed my mind to try that, so I'm not very surprised it doesn't work. But if you feel like wanting to provide a fix, I'm totally fine with accepting it.

Two things I'd suggest you try:

What happens if you wrap it in a structure like this?

struct Config {
    #[serde(flatten)]
    string: Vec<String>,
}

I suspect the real issue is in the config crate, can you try directly with that? (spirit adds all that fancy reloading on SIGHUP and combining with command line, but the parsing is done by that crate).

@jamessewell
Copy link
Author

jamessewell commented May 31, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants