Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#112387 - clarfonthey:non-panicking-ceil-char-…
…boundary, r=m-ou-se Don't panic in ceil_char_boundary Implementing the alternative mentioned in this comment: rust-lang#93743 (comment) Since `floor_char_boundary` will always work (rounding down to the length of the string is possible), it feels best for `ceil_char_boundary` to not panic either. However, the semantics of "rounding up" past the length of the string aren't very great, which is why the method originally panicked in these cases. Taking into account how people are using this method, it feels best to simply return the end of the string in these cases, so that the result is still a valid char boundary.
- Loading branch information