ritchie46 commented on pull request #353:
URL: https://github.com/apache/arrow-rs/pull/353#issuecomment-849791863


   This is `unsafe` without an `unsafe` keyword. Rust assumes valid utf8 for 
all `str` and `String` values, consequently arrow assumes this as well.
   
   If you want to create a `&str` from a slice without checking validity, you 
should use 
[https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked.html](https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked.html)
 which requires unsafe code.
   
   That `&str` can then be used in `GenericStringBuilder::append`. I don't 
think you should add an `unsafe` API for something that's already in the std 
library.


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to