library: pretty-print json config file
This commit is contained in:
parent
10cddd64a3
commit
e51c242a48
|
@ -1,5 +1,8 @@
|
|||
#Changelog
|
||||
|
||||
## bliss 0.6.5
|
||||
* Pretty-print JSON in the config file.
|
||||
|
||||
## bliss 0.6.4
|
||||
* Fix a bug in the customizable CPU number option in `library`.
|
||||
|
||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -96,7 +96,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|||
|
||||
[[package]]
|
||||
name = "bliss-audio"
|
||||
version = "0.6.4"
|
||||
version = "0.6.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bliss-audio-aubio-rs",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bliss-audio"
|
||||
version = "0.6.4"
|
||||
version = "0.6.5"
|
||||
authors = ["Polochon-street <polochonstreet@gmx.fr>"]
|
||||
edition = "2018"
|
||||
license = "GPL-3.0-only"
|
||||
|
|
|
@ -166,7 +166,7 @@ pub trait AppConfigTrait: Serialize + Sized + DeserializeOwned {
|
|||
/// using for example the various Serde libraries (`serde_yaml`, etc) -
|
||||
/// just overwrite this method.
|
||||
fn serialize_config(&self) -> Result<String> {
|
||||
Ok(serde_json::to_string(&self)?)
|
||||
Ok(serde_json::to_string_pretty(&self)?)
|
||||
}
|
||||
|
||||
/// Set the number of desired cores for analysis, and write it to the
|
||||
|
@ -2724,7 +2724,10 @@ mod test {
|
|||
#[test]
|
||||
fn test_library_new_default_write() {
|
||||
let (library, _temp_dir, _) = setup_test_library();
|
||||
let config_content = fs::read_to_string(&library.config.base_config().config_path).unwrap();
|
||||
let config_content = fs::read_to_string(&library.config.base_config().config_path)
|
||||
.unwrap()
|
||||
.replace(' ', "")
|
||||
.replace('\n', "");
|
||||
assert_eq!(
|
||||
config_content,
|
||||
format!(
|
||||
|
|
Loading…
Reference in New Issue
Block a user