From 189fc47f74708d87144c05d591c1dab52fe96c87 Mon Sep 17 00:00:00 2001 From: Helge Eichhorn Date: Sun, 10 Nov 2024 17:27:20 +0100 Subject: [PATCH] chore(lox-io): remove fast-float due to security advisory --- Cargo.lock | 7 ------- Cargo.toml | 1 - crates/lox-io/Cargo.toml | 12 +++++------- crates/lox-io/src/ndm/kvn/parser.rs | 9 ++++++--- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8dfd7ba1..72ef7ff0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,12 +211,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "fast-float" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" - [[package]] name = "fast_polynomial" version = "0.1.0" @@ -517,7 +511,6 @@ name = "lox-io" version = "0.1.0-alpha.0" dependencies = [ "csv", - "fast-float", "lox-derive", "lox-math", "nom", diff --git a/Cargo.toml b/Cargo.toml index b5e4d18b..711d460d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ lox-time = { path = "crates/lox-time", version = "0.1.0-alpha.0" } csv = "1.3.0" divan = "0.1.14" dyn-clone = "1.0.17" -fast-float = "0.2.0" fast_polynomial = "0.1.0" float_eq = "1.0.1" glam = "0.28.0" diff --git a/crates/lox-io/Cargo.toml b/crates/lox-io/Cargo.toml index 3d46c7c0..94dba76a 100644 --- a/crates/lox-io/Cargo.toml +++ b/crates/lox-io/Cargo.toml @@ -9,19 +9,17 @@ authors.workspace = true repository.workspace = true [dependencies] +lox-derive.workspace = true lox-math.workspace = true csv.workspace = true nom.workspace = true -serde.workspace = true -thiserror.workspace = true - quick-xml.workspace = true -serde_json.workspace = true -serde-aux.workspace = true regex.workspace = true -fast-float.workspace = true -lox-derive.workspace = true +serde-aux.workspace = true +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true [dev-dependencies] rstest.workspace = true diff --git a/crates/lox-io/src/ndm/kvn/parser.rs b/crates/lox-io/src/ndm/kvn/parser.rs index 939482ea..f53a3808 100644 --- a/crates/lox-io/src/ndm/kvn/parser.rs +++ b/crates/lox-io/src/ndm/kvn/parser.rs @@ -317,7 +317,9 @@ fn parse_kvn_covariance_matrix_line<'a, T: Iterator + ?Sized>( let result: Result, _> = next_line .split_whitespace() .map(|matrix_element| { - fast_float::parse(matrix_element.trim()) + matrix_element + .trim() + .parse::() .map_err(|_| KvnCovarianceMatrixParserErr::InvalidFormat { input: next_line }) }) .collect(); @@ -558,8 +560,9 @@ pub fn parse_kvn_numeric_line( let value = captures.name("value").unwrap().as_str(); let unit = captures.name("unit").map(|x| x.as_str().to_string()); - let value = - fast_float::parse(value).map_err(|_| KvnNumberParserErr::InvalidFormat { input })?; + let value = value + .parse::() + .map_err(|_| KvnNumberParserErr::InvalidFormat { input })?; Ok(KvnValue { value, unit }) }