diff --git a/arrow-cast/Cargo.toml b/arrow-cast/Cargo.toml index 86f1a431a8b2..4046f5226094 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 312e7973963e..6373cf67840a 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 d29c85c56cfd..be213c9363c2 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 dd232f197ead..517bb03d2064 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"