Prevent a crash serializing configs.
This commit is contained in:
parent
00edcae0c2
commit
8bff6ada6c
|
@ -28,7 +28,10 @@ impl Runnable for ConfigCmd {
|
||||||
|
|
||||||
"
|
"
|
||||||
.to_owned(); // The default name and location of the config file is defined in ../commands.rs
|
.to_owned(); // The default name and location of the config file is defined in ../commands.rs
|
||||||
output += &toml::to_string_pretty(&default_config)
|
// this avoids a ValueAfterTable error
|
||||||
|
// https://github.com/alexcrichton/toml-rs/issues/145
|
||||||
|
let conf = toml::Value::try_from(default_config).unwrap();
|
||||||
|
output += &toml::to_string_pretty(&conf)
|
||||||
.expect("default config should be serializable");
|
.expect("default config should be serializable");
|
||||||
match self.output_file {
|
match self.output_file {
|
||||||
Some(ref output_file) => {
|
Some(ref output_file) => {
|
||||||
|
|
Loading…
Reference in New Issue