@@ -123,8 +123,8 @@ const L_LAST: u32 = L_BASE + L_COUNT - 1;
123
123
const V_LAST : u32 = V_BASE + V_COUNT - 1 ;
124
124
const T_LAST : u32 = T_BASE + T_COUNT - 1 ;
125
125
126
- // Composition only occurs for `TPart`s in `U+11A8 ... U+11C2`,
127
- // i.e. `T_BASE + 1 ... T_LAST`.
126
+ // Composition only occurs for `TPart`s in `U+11A8 ..= U+11C2`,
127
+ // i.e. `T_BASE + 1 ..= T_LAST`.
128
128
const T_FIRST : u32 = T_BASE + 1 ;
129
129
130
130
pub ( crate ) fn is_hangul_syllable ( c : char ) -> bool {
@@ -172,15 +172,15 @@ fn compose_hangul(a: char, b: char) -> Option<char> {
172
172
let ( a, b) = ( a as u32 , b as u32 ) ;
173
173
match ( a, b) {
174
174
// Compose a leading consonant and a vowel together into an LV_Syllable
175
- ( L_BASE ... L_LAST , V_BASE ... V_LAST ) => {
175
+ ( L_BASE ..= L_LAST , V_BASE ..= V_LAST ) => {
176
176
let l_index = a - L_BASE ;
177
177
let v_index = b - V_BASE ;
178
178
let lv_index = l_index * N_COUNT + v_index * T_COUNT ;
179
179
let s = S_BASE + lv_index;
180
180
Some ( unsafe { char:: from_u32_unchecked ( s) } )
181
181
}
182
182
// Compose an LV_Syllable and a trailing consonant into an LVT_Syllable
183
- ( S_BASE ... S_LAST , T_FIRST ... T_LAST ) if ( a - S_BASE ) % T_COUNT == 0 => {
183
+ ( S_BASE ..= S_LAST , T_FIRST ..= T_LAST ) if ( a - S_BASE ) % T_COUNT == 0 => {
184
184
Some ( unsafe { char:: from_u32_unchecked ( a + ( b - T_BASE ) ) } )
185
185
}
186
186
_ => None ,
@@ -193,7 +193,7 @@ mod tests {
193
193
194
194
// Regression test from a bugfix where we were composing an LV_Syllable with
195
195
// T_BASE directly. (We should only compose an LV_Syllable with a character
196
- // in the range `T_BASE + 1 ... T_LAST`.)
196
+ // in the range `T_BASE + 1 ..= T_LAST`.)
197
197
#[ test]
198
198
fn test_hangul_composition ( ) {
199
199
assert_eq ! ( compose_hangul( '\u{c8e0}' , '\u{11a7}' ) , None ) ;
0 commit comments