Rollup merge of #32456 - bluss:str-zero, r=alexcrichton
Rollup merge of #32456 - bluss:str-zero, r=alexcrichton

Hardcode accepting 0 as a valid str char boundary

If we check explicitly for index == 0, that removes the need to read the
byte at index 0, so it avoids a trip to the string's memory, and it
optimizes out the slicing index' bounds check whenever it is (a constant) zero.

aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust