viirya commented on issue #1531:
URL: https://github.com/apache/arrow-rs/issues/1531#issuecomment-1098300414

   Hmm, @tustvold and @HaoYang670 's proposal looks good. I think It is good 
idea to follow up the standard library.
   
   >[Bytes by 
default](https://doc.rust-lang.org/std/primitive.str.html#method.get), with 
validation that it isn't [splitting a 
codepoint](https://doc.rust-lang.org/std/primitive.str.html#method.is_char_boundary)
   >Additional [Unsafe unchecked bytes 
APIs](https://doc.rust-lang.org/std/primitive.str.html#method.get_unchecked)
   >[Separate 
APIs](https://doc.rust-lang.org/std/primitive.str.html#method.chars) for 
operating on chars.
   
   About the proposal, my question is, do we really need two APIs for 
`substring` on bytes? Is the validation is necessary? As we have separate API 
for operating on chars, users should use it for utf8 cases, I think. What use 
cases it could be that `substring` is called to operate on bytes, but it still 
needs to make sure not messing up utf8 content?
   
   


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

Reply via email to