Rollup merge of #152292 - GrigorenkoPV:sigma, r=Noratrieb
Minor change for readability Everyone praise inline const blocks!
This commit is contained in:
commit
7b8be37c1f
1 changed files with 1 additions and 2 deletions
|
|
@ -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 { 'σ' }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue