rust-cli / rust-cli/config-rs

Cannot override enum values (other than string) via enviornment variables

Open
#168 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-env
Dominant language
Rust
Stars
3.2k
Forks
265
Avg merge
2h 42m
Merged PRs (30d)
4

Description

Hello, thanks for all the great work on this library. It appears that it's currently not possible to override specific enum variables/values other than string:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: invalid type: string "1", expected usize', src/main.rs:36:58
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here's a repro of the problem: https://github.com/mbellani/config-error-repro. Apologies in advance if this is something that already works and i just don't know how to use it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked config-error-repro and the failing conversion reported at src/main.rs:36:58. Trace how environment-variable strings are converted for enum fields, then verify that non-string enum values can be overridden without the reported invalid-type error.】【。

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.