etseidl commented on issue #7014:
URL: https://github.com/apache/arrow-rs/issues/7014#issuecomment-2613251782
I mentioned this in #6668, but I was thinking we could just globally replace
calls to `from_utf8` with an internal version. Something like
```rust
#[cfg(feature = "simdutf8")]
#[inline(always)]
pub fn from_utf8(val: &[u8]) -> Result<&str, simdutf8::compat::Utf8Error> {
match simdutf8::basic::from_utf8(val) {
Ok(result) => Ok(result),
Err(_) => simdutf8::compat::from_utf8(val),
}
}
#[cfg(not(feature = "simdutf8"))]
#[inline(always)]
pub fn from_utf8(val: &[u8]) -> Result<&str, std::str::Utf8Error> {
std::str::from_utf8(val)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]