rust-cli / rust-cli/config-rs

Type safety of `ConfigBuilder::set_default` in combination with `Config::try_deserialize`?

Open
#365 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently, when setting defaults with ConfigBuilder::set_default there's no type safety when used in combination with Config::try_deserialize. Meaning, that if I change the type I'm serializing to, I might miss adjusting the set_default strings accordingly. Ideally those would be coupled to my type somehow.

Not sure if this even possible. I'd be interested in contributing if someone has an idea. Thanks for the config crate either way!

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 reading the APIs for ConfigBuilder::set_default and Config::try_deserialize, then inspect related type-handling behavior and tests in the repository. Define what type-safe coupling between defaults and deserialization would require, and consider the issue complete only when the intended behavior and its testable scope are established.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.