Skip to content

Commit

Permalink
fix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbabcock committed May 24, 2024
1 parent f7a225e commit 9e685e6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/api/oconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,28 @@ impl<'a> ConfigItem<'a> {
.to_str()
.map_err(ConfigError::StringDecode)?;

let values: Result<Vec<ConfigValue<'b>>, ConfigError> =
let values = if !item.values.is_null() {
slice::from_raw_parts(item.values, item.values_num.max(0) as usize)
.iter()
.map(|x| ConfigValue::from(x))
.collect();
.collect::<Result<Vec<_>, _>>()?
} else {
Vec::new()
};

let children: Result<Vec<ConfigItem<'b>>, ConfigError> =
let children = if !item.children.is_null() {
slice::from_raw_parts(item.children, item.children_num.max(0) as usize)
.iter()
.map(|x| ConfigItem::from(x))
.collect();
.collect::<Result<Vec<_>, _>>()?
} else {
Vec::new()
};

Ok(ConfigItem {
key,
values: values?,
children: children?,
values,
children,
})
}
}

0 comments on commit 9e685e6

Please sign in to comment.