mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
671027817c
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.