Open
Description
Feature gate: #![feature(round_char_boundary)]
This is a tracking issue for str::{floor, ceil}_char_boundary
.
Public API
impl str {
// Returns the character boundary at or immediately before `index`
fn floor_char_boundary(&self, index: usize) -> usize;
// Returns the character boundary at or immediately after `index`
fn ceil_char_boundary(&self, index: usize) -> usize;
}
Steps / History
- Implementation: Add {floor,ceil}_char_boundary methods to str #86497
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Should
ceil_char_boundary
panic when indices are out of bounds? Don't panic in ceil_char_boundary #112387 is an existing PR to change this to return the length instead.