This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 3490639252 Update lexical-core requirement from 0.8 to 1.0 (to resolve 
RUSTSEC-2023-0086) (#6402)
3490639252 is described below

commit 3490639252294215c7ee05990d82b43e2cd097a6
Author: Dario Curreri <[email protected]>
AuthorDate: Tue Sep 17 12:54:22 2024 +0200

    Update lexical-core requirement from 0.8 to 1.0 (to resolve 
RUSTSEC-2023-0086) (#6402)
    
    * Update lexical-core requirement from 0.8 to 1.0
    
    * Remove safety comment
---
 arrow-cast/Cargo.toml     | 2 +-
 arrow-cast/src/display.rs | 4 +---
 arrow-csv/Cargo.toml      | 2 +-
 arrow-json/Cargo.toml     | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arrow-cast/Cargo.toml b/arrow-cast/Cargo.toml
index 86f1a431a8..4046f52260 100644
--- a/arrow-cast/Cargo.toml
+++ b/arrow-cast/Cargo.toml
@@ -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"
diff --git a/arrow-cast/src/display.rs b/arrow-cast/src/display.rs
index 312e797396..6373cf6784 100644
--- a/arrow-cast/src/display.rs
+++ b/arrow-cast/src/display.rs
@@ -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)?;
diff --git a/arrow-csv/Cargo.toml b/arrow-csv/Cargo.toml
index d29c85c56c..be213c9363 100644
--- a/arrow-csv/Cargo.toml
+++ b/arrow-csv/Cargo.toml
@@ -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]
diff --git a/arrow-json/Cargo.toml b/arrow-json/Cargo.toml
index dd232f197e..517bb03d20 100644
--- a/arrow-json/Cargo.toml
+++ b/arrow-json/Cargo.toml
@@ -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"

Reply via email to