Skip to content

Commit

Permalink
Update lexical-core requirement from 0.8 to 1.0 (to resolve RUSTSEC-2…
Browse files Browse the repository at this point in the history
…023-0086) (#6402)

* Update lexical-core requirement from 0.8 to 1.0

* Remove safety comment
  • Loading branch information
dariocurr authored Sep 17, 2024
1 parent 341ec35 commit 3490639
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arrow-cast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ arrow-select = { workspace = true }
chrono = { workspace = true }
half = { version = "2.1", default-features = false }
num = { version = "0.4", default-features = false, features = ["std"] }
lexical-core = { version = "^0.8", default-features = false, features = ["write-integers", "write-floats", "parse-integers", "parse-floats"] }
lexical-core = { version = "1.0", default-features = false, features = ["write-integers", "write-floats", "parse-integers", "parse-floats"] }
atoi = "2.0.0"
comfy-table = { version = "7.0", optional = true, default-features = false }
base64 = "0.22"
Expand Down
4 changes: 1 addition & 3 deletions arrow-cast/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,7 @@ macro_rules! primitive_display {
fn write(&self, idx: usize, f: &mut dyn Write) -> FormatResult {
let value = self.value(idx);
let mut buffer = [0u8; <$t as ArrowPrimitiveType>::Native::FORMATTED_SIZE];
// SAFETY:
// buffer is T::FORMATTED_SIZE
let b = unsafe { lexical_core::write_unchecked(value, &mut buffer) };
let b = lexical_core::write(value, &mut buffer);
// Lexical core produces valid UTF-8
let s = unsafe { std::str::from_utf8_unchecked(b) };
f.write_str(s)?;
Expand Down
2 changes: 1 addition & 1 deletion arrow-csv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ chrono = { workspace = true }
csv = { version = "1.1", default-features = false }
csv-core = { version = "0.1" }
lazy_static = { version = "1.4", default-features = false }
lexical-core = { version = "^0.8", default-features = false }
lexical-core = { version = "1.0", default-features = false }
regex = { version = "1.7.0", default-features = false, features = ["std", "unicode", "perf"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion arrow-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ num = { version = "0.4", default-features = false, features = ["std"] }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
chrono = { workspace = true }
lexical-core = { version = "0.8", default-features = false }
lexical-core = { version = "1.0", default-features = false}

[dev-dependencies]
tempfile = "3.3"
Expand Down

0 comments on commit 3490639

Please sign in to comment.