Context
From PR #1642 discussion, questions were raised about the naming and structure of CliConfig and CliClient constructors.
Current API
CliConfig::default() - creates a config with default relative paths
CliConfig::from_system() - loads config from local/global .miden directories (recommended)
CliClient::from_system_user_config() - creates a client using CLI config discovery (recommended)
Feedback
- The naming
from_system() and from_system_user_config() doesn't clearly convey these are the recommended constructors
- The role of
CliConfig::default() vs from_system() may be confusing to users
Current constraints
Default::default() is used by the figment Provider trait impl (config.rs:71) and the init command (init.rs:167)
- Using
default() for filesystem I/O would be non-idiomatic in Rust
Potential approaches
- Rename to more intuitive names (e.g.,
CliClient::new(), CliConfig::load())
- Keep current naming but improve documentation
- Restructure to make the recommended path more obvious
References
Context
From PR #1642 discussion, questions were raised about the naming and structure of
CliConfigandCliClientconstructors.Current API
CliConfig::default()- creates a config with default relative pathsCliConfig::from_system()- loads config from local/global.midendirectories (recommended)CliClient::from_system_user_config()- creates a client using CLI config discovery (recommended)Feedback
from_system()andfrom_system_user_config()doesn't clearly convey these are the recommended constructorsCliConfig::default()vsfrom_system()may be confusing to usersCurrent constraints
Default::default()is used by the figmentProvidertrait impl (config.rs:71) and theinitcommand (init.rs:167)default()for filesystem I/O would be non-idiomatic in RustPotential approaches
CliClient::new(),CliConfig::load())References