Skip to content

Commit

Permalink
chore(lox-io): remove fast-float due to security advisory
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Nov 10, 2024
1 parent 83e51d3 commit 189fc47
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 5 additions & 7 deletions crates/lox-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions crates/lox-io/src/ndm/kvn/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ fn parse_kvn_covariance_matrix_line<'a, T: Iterator<Item = &'a str> + ?Sized>(
let result: Result<Vec<f64>, _> = next_line
.split_whitespace()
.map(|matrix_element| {
fast_float::parse(matrix_element.trim())
matrix_element
.trim()
.parse::<f64>()
.map_err(|_| KvnCovarianceMatrixParserErr::InvalidFormat { input: next_line })
})
.collect();
Expand Down Expand Up @@ -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::<f64>()
.map_err(|_| KvnNumberParserErr::InvalidFormat { input })?;

Ok(KvnValue { value, unit })
}
Expand Down

0 comments on commit 189fc47

Please sign in to comment.