@@ -80,11 +80,11 @@ impl fmt::Display for UnicodeWordError {
80
80
/// This returns an error if the Unicode case folding tables are not available.
81
81
pub fn simple_fold (
82
82
c : char ,
83
- ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > > {
83
+ ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > > {
84
84
#[ cfg( not( feature = "unicode-case" ) ) ]
85
85
fn imp (
86
86
_: char ,
87
- ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > >
87
+ ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > >
88
88
{
89
89
use std:: option:: IntoIter ;
90
90
Err :: < result:: Result < IntoIter < char > , _ > , _ > ( CaseFoldError ( ( ) ) )
@@ -93,7 +93,7 @@ pub fn simple_fold(
93
93
#[ cfg( feature = "unicode-case" ) ]
94
94
fn imp (
95
95
c : char ,
96
- ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > >
96
+ ) -> FoldResult < result:: Result < impl Iterator < Item = char > , Option < char > > >
97
97
{
98
98
use crate :: unicode_tables:: case_folding_simple:: CASE_FOLDING_SIMPLE ;
99
99
@@ -220,7 +220,7 @@ impl<'a> ClassQuery<'a> {
220
220
let canon_val =
221
221
match canonical_value ( vals, & property_value) {
222
222
None => {
223
- return Err ( Error :: PropertyValueNotFound )
223
+ return Err ( Error :: PropertyValueNotFound ) ;
224
224
}
225
225
Some ( canon_val) => canon_val,
226
226
} ;
@@ -243,7 +243,9 @@ impl<'a> ClassQuery<'a> {
243
243
// a general category. (Currently, we don't even support the
244
244
// 'Case_Folding' property. But if we do in the future, users will be
245
245
// required to spell it out.)
246
- if norm != "cf" {
246
+ // 'sc' refers to the 'Currency_Symbol' general category, but is also
247
+ // the abbreviation for the 'Script' property.
248
+ if norm != "cf" && norm != "sc" {
247
249
if let Some ( canon) = canonical_prop ( & norm) ? {
248
250
return Ok ( CanonicalClassQuery :: Binary ( canon) ) ;
249
251
}
@@ -462,24 +464,24 @@ fn canonical_script(normalized_value: &str) -> Result<Option<&'static str>> {
462
464
/// If the property names data is not available, then an error is returned.
463
465
fn canonical_prop ( normalized_name : & str ) -> Result < Option < & ' static str > > {
464
466
#[ cfg( not( any(
465
- feature = "unicode-age" ,
466
- feature = "unicode-bool" ,
467
- feature = "unicode-gencat" ,
468
- feature = "unicode-perl" ,
469
- feature = "unicode-script" ,
470
- feature = "unicode-segment" ,
467
+ feature = "unicode-age" ,
468
+ feature = "unicode-bool" ,
469
+ feature = "unicode-gencat" ,
470
+ feature = "unicode-perl" ,
471
+ feature = "unicode-script" ,
472
+ feature = "unicode-segment" ,
471
473
) ) ) ]
472
474
fn imp ( _: & str ) -> Result < Option < & ' static str > > {
473
475
Err ( Error :: PropertyNotFound )
474
476
}
475
477
476
478
#[ cfg( any(
477
- feature = "unicode-age" ,
478
- feature = "unicode-bool" ,
479
- feature = "unicode-gencat" ,
480
- feature = "unicode-perl" ,
481
- feature = "unicode-script" ,
482
- feature = "unicode-segment" ,
479
+ feature = "unicode-age" ,
480
+ feature = "unicode-bool" ,
481
+ feature = "unicode-gencat" ,
482
+ feature = "unicode-perl" ,
483
+ feature = "unicode-script" ,
484
+ feature = "unicode-segment" ,
483
485
) ) ]
484
486
fn imp ( name : & str ) -> Result < Option < & ' static str > > {
485
487
use crate :: unicode_tables:: property_names:: PROPERTY_NAMES ;
@@ -519,24 +521,24 @@ fn property_values(
519
521
canonical_property_name : & ' static str ,
520
522
) -> Result < Option < PropertyValues > > {
521
523
#[ cfg( not( any(
522
- feature = "unicode-age" ,
523
- feature = "unicode-bool" ,
524
- feature = "unicode-gencat" ,
525
- feature = "unicode-perl" ,
526
- feature = "unicode-script" ,
527
- feature = "unicode-segment" ,
524
+ feature = "unicode-age" ,
525
+ feature = "unicode-bool" ,
526
+ feature = "unicode-gencat" ,
527
+ feature = "unicode-perl" ,
528
+ feature = "unicode-script" ,
529
+ feature = "unicode-segment" ,
528
530
) ) ) ]
529
531
fn imp ( _: & ' static str ) -> Result < Option < PropertyValues > > {
530
532
Err ( Error :: PropertyValueNotFound )
531
533
}
532
534
533
535
#[ cfg( any(
534
- feature = "unicode-age" ,
535
- feature = "unicode-bool" ,
536
- feature = "unicode-gencat" ,
537
- feature = "unicode-perl" ,
538
- feature = "unicode-script" ,
539
- feature = "unicode-segment" ,
536
+ feature = "unicode-age" ,
537
+ feature = "unicode-bool" ,
538
+ feature = "unicode-gencat" ,
539
+ feature = "unicode-perl" ,
540
+ feature = "unicode-script" ,
541
+ feature = "unicode-segment" ,
540
542
) ) ]
541
543
fn imp ( name : & ' static str ) -> Result < Option < PropertyValues > > {
542
544
use crate :: unicode_tables:: property_values:: PROPERTY_VALUES ;
@@ -569,15 +571,15 @@ fn property_set(
569
571
///
570
572
/// If the given age value isn't valid or if the data isn't available, then an
571
573
/// error is returned instead.
572
- fn ages ( canonical_age : & str ) -> Result < impl Iterator < Item = Range > > {
574
+ fn ages ( canonical_age : & str ) -> Result < impl Iterator < Item = Range > > {
573
575
#[ cfg( not( feature = "unicode-age" ) ) ]
574
- fn imp ( _: & str ) -> Result < impl Iterator < Item = Range > > {
576
+ fn imp ( _: & str ) -> Result < impl Iterator < Item = Range > > {
575
577
use std:: option:: IntoIter ;
576
578
Err :: < IntoIter < Range > , _ > ( Error :: PropertyNotFound )
577
579
}
578
580
579
581
#[ cfg( feature = "unicode-age" ) ]
580
- fn imp ( canonical_age : & str ) -> Result < impl Iterator < Item = Range > > {
582
+ fn imp ( canonical_age : & str ) -> Result < impl Iterator < Item = Range > > {
581
583
use crate :: unicode_tables:: age;
582
584
583
585
const AGES : & [ ( & str , Range ) ] = & [
@@ -878,7 +880,7 @@ mod tests {
878
880
} ;
879
881
880
882
#[ cfg( feature = "unicode-case" ) ]
881
- fn simple_fold_ok ( c : char ) -> impl Iterator < Item = char > {
883
+ fn simple_fold_ok ( c : char ) -> impl Iterator < Item = char > {
882
884
simple_fold ( c) . unwrap ( ) . unwrap ( )
883
885
}
884
886
0 commit comments