From cbf61d155b53aac15babefa9a0c7397ab542969a Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Thu, 25 Aug 2022 00:48:41 +0900 Subject: [PATCH] omitted output when tag data is none --- src/afterfact.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index f19913b1..0359aa79 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -859,7 +859,7 @@ fn output_json_str( let mut value: Vec = vec![]; if values.is_empty() { - value.push("[".to_string()); + continue; } for (idx, tag_val) in values.iter().enumerate() { if idx == 0 { @@ -871,11 +871,7 @@ fn output_json_str( value.push(",\n".to_string()); } } - if values.is_empty() { - value.push("]".to_string()); - } else { - value.push("\n ]".to_string()); - } + value.push("\n ]".to_string()); let fmted_val = value.join(""); target.push(_create_json_output_format(