From 08ddbbf77e73ffe671699d03372cf3e94bccf6cc Mon Sep 17 00:00:00 2001 From: Alicja Januszkiewicz Date: Sun, 17 Sep 2023 18:47:12 +0100 Subject: [PATCH] fix clippy-nightly issues and rebase --- crates/polars-core/src/fmt.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/polars-core/src/fmt.rs b/crates/polars-core/src/fmt.rs index d47f4722b88f7..416958b7be979 100644 --- a/crates/polars-core/src/fmt.rs +++ b/crates/polars-core/src/fmt.rs @@ -45,7 +45,7 @@ pub fn get_float_fmt() -> FloatFmt { } pub fn get_float_precision() -> Option { - FLOAT_PRECISION.read().unwrap().clone() + *FLOAT_PRECISION.read().unwrap() } pub fn set_float_fmt(fmt: FloatFmt) { @@ -727,14 +727,11 @@ fn fmt_float(f: &mut Formatter<'_>, width: usize, v: T) -> fmt let float_precision = get_float_precision(); - match float_precision { - Some(precision) => { - if format!("{v:.precision$}", precision = precision).len() > 19 { - return write!(f, "{v:>width$.precision$e}", precision = precision); - } - return write!(f, "{v:>width$.precision$}", precision = precision); - }, - _ => {}, + if let Some(precision) = float_precision { + if format!("{v:.precision$}", precision = precision).len() > 19 { + return write!(f, "{v:>width$.precision$e}", precision = precision); + } + return write!(f, "{v:>width$.precision$}", precision = precision); } if matches!(get_float_fmt(), FloatFmt::Full) {