We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbd92a4 commit 1e29e96Copy full SHA for 1e29e96
1 file changed
components/hab/src/command/plan/render.rs
@@ -119,9 +119,9 @@ pub fn start(ui: &mut UI,
119
}
120
121
fn toml_to_json(cfg: &str) -> Result<Json> {
122
- let toml_value = cfg.parse::<Value>()?;
123
- let toml_string = serde_json::to_string(&toml_value)?;
124
- let json = serde_json::from_str(&format!(r#"{{ "cfg": {} }}"#, &toml_string))?;
+ let toml_value: Value = toml::from_str(cfg).map_err(crate::error::Error::from)?;
+ let toml_string = serde_json::to_string(&toml_value).map_err(crate::error::Error::from)?;
+ let json = serde_json::from_str(&format!(r#"{{ "cfg": {} }}"#, &toml_string)).map_err(crate::error::Error::from)?;
125
Ok(json)
126
127
0 commit comments