rust-cli / rust-cli/config-rs

Re-thinking: Support deserializing key-value config data

Open
#322 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

config-rs should be able to support key-value configuration data of the following types:

  • Bool
  • Integer
  • Float
  • String
  • List of "value"
  • Key-Value Mapping of "String" to "Value"

Something like

#[derive(serde::Deserialize)]
enum Value {
    Bool(bool),
    Int(i64),
    Float(f64),
    Text(String),
    List(Vec<Value>),
    Map(HashMap<String, Value>),
}

Should be the basis of all operations. This data format can be deserialized from different sources and be used for the "layering" functionality later.
It might be even possible to implement in a non-owning way.

We should keep the currently supported formats as supported formats in the future.

That entails:

  • Toml
  • Json
  • INI
  • Yaml
  • Ron
  • Json5

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 by reviewing config-rs's current deserialization paths for TOML, JSON, INI, YAML, RON, and JSON5, then examine how configuration layering is expected to use their data. Done means the proposed key-value data model supports Bool, Integer, Float, String, List, and Map values while all currently supported formats remain supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.