shuttle-hq / synth

The Declarative Data Generator
https://www.getsynth.com/
Apache License 2.0
1.36k stars 105 forks source link

fix: Fix panic during CSV import when encountering invalid floats #433

Closed moore-ryan closed 1 year ago

moore-ryan commented 1 year ago

This fix will address #432, which was caused by an unchecked unwrap() after trying to convert a F64 value to a JSON Number. Since JSON Numbers cannot wrap NaN or Inf values, this would previously fail if encountering a string of the form "Nan" or "Inf"

Additionally, this change bumps up the version of the log dependency in synth/Cargo.toml from 0.4.11 to 0.4.18 to fix a compilation issue on recent nightly toolchains (see this issue in async-std for more info)

moore-ryan commented 1 year ago

Ah, I had run clippy, but did not fix up the warning because it was in existing code. Just pushed a changeset after running cargo fmt and cargo clippy (had to add an #[allow for clippy to pass, there was an existing unit test that was using a default unit struct).