Skip to content

Commit 1e29e96

Browse files
author
Jason Heath
committed
Fixes hab plan render
Signed-off-by: Jason Heath <jason.heath@progress.com>
1 parent dbd92a4 commit 1e29e96

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

components/hab/src/command/plan/render.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ pub fn start(ui: &mut UI,
119119
}
120120

121121
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))?;
122+
let toml_value: Value = toml::from_str(cfg).map_err(crate::error::Error::from)?;
123+
let toml_string = serde_json::to_string(&toml_value).map_err(crate::error::Error::from)?;
124+
let json = serde_json::from_str(&format!(r#"{{ "cfg": {} }}"#, &toml_string)).map_err(crate::error::Error::from)?;
125125
Ok(json)
126126
}
127127

0 commit comments

Comments
 (0)