get rid of hidden mutability of Spec (#10904)

* get rid of hidden mutabilityof Spec

* small cleanups

* fixed SpecHardcodedSync printing
This commit is contained in:
Marek Kotewicz
2019-07-30 12:48:54 +02:00
committed by GitHub
parent 12256a1e97
commit 6c7d0fef4e
7 changed files with 183 additions and 177 deletions

View File

@@ -96,7 +96,7 @@ pub fn execute(cmd: ExportHsyncCmd) -> Result<String, String> {
let hs = service.client().read_hardcoded_sync()
.map_err(|e| format!("Error reading hardcoded sync: {}", e))?;
if let Some(hs) = hs {
Ok(::serde_json::to_string_pretty(&hs.to_json()).expect("generated JSON is always valid"))
Ok(format!("{}", hs))
} else {
Err("Error: cannot generate hardcoded sync because the database is empty.".into())
}