add comments

This commit is contained in:
Alex Chi
2023-06-05 13:27:00 -04:00
parent b23e085efb
commit 5da45b182d

View File

@@ -250,6 +250,9 @@ fn parse_json(s: &str) -> Result<serde_json::Value, serde_json::Error> {
impl TenantConfig {
pub fn deserialize_from_settings(settings: HashMap<&str, &str>) -> Result<Self, anyhow::Error> {
// Here we are using `clap` to parse the settings. This is not ideal, but it's the easiest
// way to simplify th code. To convert settings into a list of command line arguments, we
// need the program name argv0, each key into a long-form option, and each value proceeding it.
let config = TenantConfig::try_parse_from(
std::iter::once("argv0".to_string()).chain(
settings