Skip to content

Commit b6b6567

Browse files
author
Jason Heath
committed
Import and use sserde_json::from_slice in builder-core/src/build_config.rs
Signed-off-by: Jason Heath <jason.heath@progress.com>
1 parent aa4c872 commit b6b6567

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

components/builder-core/src/build_config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ use std::{collections::{HashMap,
2222
str::FromStr,
2323
string::ToString};
2424

25+
use serde_json::from_slice;
26+
2527
use serde::{de,
2628
Deserialize,
2729
Deserializer,
@@ -41,8 +43,10 @@ pub struct BuildCfg(HashMap<String, ProjectCfg>);
4143

4244
impl BuildCfg {
4345
pub fn from_slice(bytes: &[u8]) -> Result<Self> {
44-
let inner = toml::from_slice::<HashMap<String, ProjectCfg>>(bytes)
45-
.map_err(|e| Error::DecryptError(e.to_string()))?;
46+
let inner =
47+
from_slice::<HashMap<String, ProjectCfg>>(bytes).map_err(|e| {
48+
Error::DecryptError(e.to_string())
49+
})?;
4650
Ok(BuildCfg(inner))
4751
}
4852

0 commit comments

Comments
 (0)