Rollup merge of #152292 - GrigorenkoPV:sigma, r=Noratrieb

Minor change for readability

Everyone praise inline const blocks!
This commit is contained in:
Jonathan Brouwer 2026-02-07 19:34:51 +01:00 committed by GitHub
commit 7b8be37c1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -411,9 +411,8 @@ impl str {
fn map_uppercase_sigma(from: &str, i: usize) -> char {
// See https://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992
// for the definition of `Final_Sigma`.
debug_assert!('Σ'.len_utf8() == 2);
let is_word_final = case_ignorable_then_cased(from[..i].chars().rev())
&& !case_ignorable_then_cased(from[i + 2..].chars());
&& !case_ignorable_then_cased(from[i + const { 'Σ'.len_utf8() }..].chars());
if is_word_final { 'ς' } else { 'σ' }
}