From b04eb5a1382efe99c42dc5d1f04703be02d8d07b Mon Sep 17 00:00:00 2001 From: jtmoon79 <815261+jtmoon79@users.noreply.github.com> Date: Sat, 22 Jun 2024 23:47:03 -0700 Subject: [PATCH] (BIN) NFC s4.rs clippy tweaks --- src/bin/s4.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/bin/s4.rs b/src/bin/s4.rs index fbf6edf9..6eac1588 100644 --- a/src/bin/s4.rs +++ b/src/bin/s4.rs @@ -882,12 +882,9 @@ fn cli_process_tz_offset(tzo: &str) -> std::result::Result ] { let dt = datetime_parse_from_str_w_tz(data.as_str(), pattern); defo!("datetime_parse_from_str_w_tz({:?}, {:?}) returned {:?}", data, pattern, dt); - match dt { - Some(dt_) => { - defx!("return {:?}", dt_.offset()); - return Ok(*dt_.offset()); - } - None => {} + if let Some(dt_) = dt { + defx!("return {:?}", dt_.offset()); + return Ok(*dt_.offset()); } } @@ -2012,11 +2009,8 @@ fn exec_syslogprocessor( break; } // try to drop the prior SyslineP (and associated data) - match syslinep_last_opt { - Some(syslinep_last) => { - syslogproc.drop_data_try(&syslinep_last); - } - None => {} + if let Some(syslinep_last) = syslinep_last_opt { + syslogproc.drop_data_try(&syslinep_last); } syslinep_last_opt = Some(syslinep_tmp); }