This commit is contained in:
Love 2025-01-07 17:25:02 +01:00
parent 2d99957771
commit 0d3ca81319

View File

@ -82,12 +82,12 @@ async fn main() -> ExitCode {
});
}
if cli.compact {
serde_json::to_string(&json_values)
let to_string_json = if cli.compact {
serde_json::to_string
} else {
serde_json::to_string_pretty(&json_values)
}
.expect("Failed to parse content as JSON")
serde_json::to_string_pretty
};
to_string_json(&json_values).expect("Failed to parse content as JSON")
}
FormatOption::Plain => parsed
.iter()