@@ -257,7 +257,7 @@ impl Keysym {
257
257
|| ucs > 0x10ffff
258
258
|| ( ucs & 0xfffe == 0xfffe )
259
259
{
260
- return NO_SYMBOL ;
260
+ return Keysym :: NoSymbol ;
261
261
}
262
262
263
263
// Search main table.
@@ -283,7 +283,7 @@ impl From<Keysym> for u32 {
283
283
}
284
284
285
285
/// The "empty" keyboard symbol.
286
- pub const NO_SYMBOL : Keysym = Keysym ( 0 ) ;
286
+ pub const NO_SYMBOL : Keysym = Keysym :: NoSymbol ;
287
287
288
288
/// Get the keyboard symbol from a keyboard code and its column.
289
289
///
@@ -318,8 +318,8 @@ pub fn keysym(
318
318
break ;
319
319
}
320
320
321
- // If the keysym we're looking at isn't NO_SYMBOL , we're done.
322
- if keysyms[ per - 1 ] != NO_SYMBOL . 0 {
321
+ // If the keysym we're looking at isn't NoSymbol , we're done.
322
+ if keysyms[ per - 1 ] != Keysym :: NoSymbol . 0 {
323
323
break ;
324
324
}
325
325
@@ -336,7 +336,7 @@ pub fn keysym(
336
336
337
337
// Convert to upper/lower ourselves if the keysym doesn't support it.
338
338
let alt_column = ( column | 1 ) as usize ;
339
- if per <= alt_column || keysyms[ alt_column] == NO_SYMBOL . 0 {
339
+ if per <= alt_column || keysyms[ alt_column] == Keysym :: NoSymbol . 0 {
340
340
// Convert to upper/lower case.
341
341
let ( upper, lower) = convert_case ( Keysym ( * keysyms. get ( column as usize & !1 ) ?) ) ;
342
342
return Some ( if column & 1 == 0 { upper } else { lower } ) ;
@@ -1263,20 +1263,20 @@ mod tests {
1263
1263
// Unicode non-characters.
1264
1264
1265
1265
// rust doesn't allow building the char from the surrogates.
1266
- // assert_eq!(Keysym::from_char('\u{d800}'), NO_SYMBOL )); // Unicode surrogates
1267
- // assert_eq!(Keysym::from_char('\u{dfff}'), NO_SYMBOL )); // Unicode surrogates
1268
-
1269
- assert_eq ! ( Keysym :: from_char( '\u{fdd0}' ) , NO_SYMBOL ) ;
1270
- assert_eq ! ( Keysym :: from_char( '\u{fdef}' ) , NO_SYMBOL ) ;
1271
- assert_eq ! ( Keysym :: from_char( '\u{fffe}' ) , NO_SYMBOL ) ;
1272
- assert_eq ! ( Keysym :: from_char( '\u{ffff}' ) , NO_SYMBOL ) ;
1273
- assert_eq ! ( Keysym :: from_char( '\u{7fffe}' ) , NO_SYMBOL ) ;
1274
- assert_eq ! ( Keysym :: from_char( '\u{7ffff}' ) , NO_SYMBOL ) ;
1275
- assert_eq ! ( Keysym :: from_char( '\u{afffe}' ) , NO_SYMBOL ) ;
1276
- assert_eq ! ( Keysym :: from_char( '\u{affff}' ) , NO_SYMBOL ) ;
1266
+ // assert_eq!(Keysym::from_char('\u{d800}'), Keysym::NoSymbol )); // Unicode surrogates
1267
+ // assert_eq!(Keysym::from_char('\u{dfff}'), Keysym::NoSymbol )); // Unicode surrogates
1268
+
1269
+ assert_eq ! ( Keysym :: from_char( '\u{fdd0}' ) , Keysym :: NoSymbol ) ;
1270
+ assert_eq ! ( Keysym :: from_char( '\u{fdef}' ) , Keysym :: NoSymbol ) ;
1271
+ assert_eq ! ( Keysym :: from_char( '\u{fffe}' ) , Keysym :: NoSymbol ) ;
1272
+ assert_eq ! ( Keysym :: from_char( '\u{ffff}' ) , Keysym :: NoSymbol ) ;
1273
+ assert_eq ! ( Keysym :: from_char( '\u{7fffe}' ) , Keysym :: NoSymbol ) ;
1274
+ assert_eq ! ( Keysym :: from_char( '\u{7ffff}' ) , Keysym :: NoSymbol ) ;
1275
+ assert_eq ! ( Keysym :: from_char( '\u{afffe}' ) , Keysym :: NoSymbol ) ;
1276
+ assert_eq ! ( Keysym :: from_char( '\u{affff}' ) , Keysym :: NoSymbol ) ;
1277
1277
1278
1278
// Rust doesn't allow codepoints outside the Unicode planes for char.
1279
- // assert_eq!(Keysym::from_char('\u{110000}', NO_SYMBOL );
1280
- // assert_eq!(Keysym::from_char('\u{deadbeef}', NO_SYMBOL );
1279
+ // assert_eq!(Keysym::from_char('\u{110000}', Keysym::NoSymbol );
1280
+ // assert_eq!(Keysym::from_char('\u{deadbeef}', Keysym::NoSymbol );
1281
1281
}
1282
1282
}
0 commit comments