config refactor

This commit is contained in:
John Smith
2022-02-09 10:00:19 -05:00
parent b9862b0016
commit dfd995036a
4 changed files with 23 additions and 260 deletions

View File

@@ -236,8 +236,10 @@ impl VeilidConfig {
}
pub async fn init_from_json(&mut self, config: String) -> Result<(), String> {
let mut inner = self.inner.write();
*inner = serde_json::from_str(&config).map_err(map_to_string)?;
{
let mut inner = self.inner.write();
*inner = serde_json::from_str(&config).map_err(map_to_string)?;
}
// Validate settings
self.validate().await?;