From 5d4bc9c521e054b4a91e3b348237717313371e1e Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sat, 6 Jan 2024 23:40:49 -0500 Subject: [PATCH] utils: minor tweaks - in count_rows() helper, let compiler know we don't care about the contents of the record - inline round_num() helper --- src/util.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.rs b/src/util.rs index cd5f85222..ac704cd34 100644 --- a/src/util.rs +++ b/src/util.rs @@ -301,8 +301,8 @@ pub fn count_rows(conf: &Config) -> Result { let rc = ROW_COUNT.get_or_init(|| { if let Ok(mut rdr) = conf.reader() { let mut count = 0_u64; - let mut record = csv::ByteRecord::new(); - while rdr.read_byte_record(&mut record).unwrap_or_default() { + let mut _record = csv::ByteRecord::new(); + while rdr.read_byte_record(&mut _record).unwrap_or_default() { count += 1; } count @@ -1180,6 +1180,7 @@ impl ColumnNameParser { } } +#[inline] pub fn round_num(dec_f64: f64, places: u32) -> String { use rust_decimal::{Decimal, RoundingStrategy};