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

Using features - fails if using ron_conf or yaml_conf #105

Open
ghenry opened this issue Nov 25, 2024 · 3 comments
Open

Using features - fails if using ron_conf or yaml_conf #105

ghenry opened this issue Nov 25, 2024 · 3 comments

Comments

@ghenry
Copy link

ghenry commented Nov 25, 2024

Hi,

If I set a feature to ron_conf or yaml_conf using:

confy = { version = "0.6.1", features = ["ron_conf"] }

I get:

error[E0428]: the name `EXTENSION` is defined multiple times
   --> /home/ghenry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/confy-0.6.1/src/lib.rs:107:1
    |
101 | const EXTENSION: &str = "toml";
    | ------------------------------- previous definition of the value `EXTENSION` here
...
107 | const EXTENSION: &str = "ron";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `EXTENSION` redefined here
    |
    = note: `EXTENSION` must be defined only once in the value namespace of this module

error: Exactly one config language feature must be enabled to compile confy.  Please disable one of either the `toml_conf`, `yaml_conf`, or `ron_conf` features. NOTE: `toml_conf` is a default feature, so disabling it might mean switching off default features for confy in your Cargo.toml
  --> /home/ghenry/.cargo/registry/src/index.crates.io-6f17d22bba15001f/confy-0.6.1/src/lib.rs:93:1
   |
93 | / compile_error!(
94 | |     "Exactly one config language feature must be enabled to compile \
95 | | confy.  Please disable one of either the `toml_conf`, `yaml_conf`, or `ron_conf` features. \
96 | | NOTE: `toml_conf` is a default feature, so disabling it might mean switching off \
97 | | default features for confy in your Cargo.toml"
98 | | );

Am I doing something wrong?

Thanks.

@deg4uss3r
Copy link
Contributor

deg4uss3r commented Nov 25, 2024

Hello @ghenry Looks like I need to make at least a docs update but it's erroring out here because we have toml set as the default feature on, and you have activated another feature to get this to compile today you'll need to update your Cargo.toml to:

[dependencies]
confy = { version = "0.6.1", default-features = false, features = ["ron_conf"] }

and it will compile fine with only ron support.

I'll investigate further to see if we can at least update the documentation/error handing here.

@ghenry
Copy link
Author

ghenry commented Nov 25, 2024

Ah, thanks. I was reading the source to do a PR, but couldn't see the default one you've highlighted.

@deg4uss3r
Copy link
Contributor

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