Skip to content

Commit

Permalink
fix clippy-nightly issues and rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alicja-januszkiewicz committed Sep 17, 2023
1 parent 16aaebb commit 08ddbbf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions crates/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn get_float_fmt() -> FloatFmt {
}

pub fn get_float_precision() -> Option<usize> {
FLOAT_PRECISION.read().unwrap().clone()
*FLOAT_PRECISION.read().unwrap()
}

pub fn set_float_fmt(fmt: FloatFmt) {
Expand Down Expand Up @@ -727,14 +727,11 @@ fn fmt_float<T: Num + NumCast>(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) {
Expand Down

0 comments on commit 08ddbbf

Please sign in to comment.