From c06327dee512c411957b7c73741af18394ac1706 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Tue, 6 Sep 2022 14:50:58 +0800 Subject: [PATCH] clippy Signed-off-by: TennyZhuang --- src/expr/src/expr/expr_to_char_const_tmpl.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/expr/src/expr/expr_to_char_const_tmpl.rs b/src/expr/src/expr/expr_to_char_const_tmpl.rs index 8822092d2c67d..a4d514f2c816e 100644 --- a/src/expr/src/expr/expr_to_char_const_tmpl.rs +++ b/src/expr/src/expr/expr_to_char_const_tmpl.rs @@ -46,13 +46,11 @@ impl Expression for ExprToCharConstTmpl { for (data, vis) in data_arr.iter().zip_eq(input.vis().iter()) { if !vis { output.append_null()?; + } else if let Some(data) = data { + let res = data.0.format(&self.ctx.chrono_tmpl).to_string(); + output.append(Some(res.as_str()))?; } else { - if let Some(data) = data { - let res = data.0.format(&self.ctx.chrono_tmpl).to_string(); - output.append(Some(res.as_str()))?; - } else { - output.append_null()?; - } + output.append_null()?; } }