@@ -22,11 +22,10 @@ fn detect_all_groupings(pattern: &str) -> Vec<usize> {
2222 if let Some ( primary) = parts. last ( ) {
2323 sizes. push ( primary. len ( ) ) ;
2424 }
25- if parts. len ( ) > 2 {
26- if let Some ( secondary) = parts. get ( parts. len ( ) - 2 ) {
25+ if parts. len ( ) > 2
26+ && let Some ( secondary) = parts. get ( parts. len ( ) - 2 ) {
2727 sizes. push ( secondary. len ( ) ) ;
2828 }
29- }
3029
3130 if sizes. len ( ) > 1 && sizes[ 0 ] == sizes[ 1 ] {
3231 sizes. truncate ( 1 ) ;
@@ -47,16 +46,15 @@ pub fn run(
4746 let json: Value = serde_json:: from_reader ( & mut file) ?;
4847 if let Some ( systems) = json[ "supplemental" ] [ "numberingSystems" ] . as_object ( ) {
4948 for ( name, data) in systems {
50- if data[ "_type" ] . as_str ( ) == Some ( "numeric" ) {
51- if let Some ( digits_str) = data[ "_digits" ] . as_str ( ) {
49+ if data[ "_type" ] . as_str ( ) == Some ( "numeric" )
50+ && let Some ( digits_str) = data[ "_digits" ] . as_str ( ) {
5251 let chars: Vec < char > = digits_str. chars ( ) . collect ( ) ;
5352 if chars. len ( ) == 10 {
5453 let mut arr = [ '0' ; 10 ] ;
5554 arr. copy_from_slice ( & chars[ ..10 ] ) ;
5655 system_digit_map. insert ( name. to_string ( ) , arr) ;
5756 }
5857 }
59- }
6058 }
6159 }
6260 }
@@ -66,13 +64,11 @@ pub fn run(
6664 let file = archive. by_index ( i) ?;
6765 if file. name ( ) . contains ( "/main/" ) && file. is_dir ( ) {
6866 let parts: Vec < & str > = file. name ( ) . split ( '/' ) . collect ( ) ;
69- if let Some ( idx) = parts. iter ( ) . position ( |& r| r == "main" ) {
70- if let Some ( name) = parts. get ( idx + 1 ) {
71- if !name. is_empty ( ) && !locales. contains ( & ( * name) . to_string ( ) ) {
67+ if let Some ( idx) = parts. iter ( ) . position ( |& r| r == "main" )
68+ && let Some ( name) = parts. get ( idx + 1 )
69+ && !name. is_empty ( ) && !locales. contains ( & ( * name) . to_string ( ) ) {
7270 locales. push ( ( * name) . to_string ( ) ) ;
7371 }
74- }
75- }
7672 }
7773 }
7874 locales. sort ( ) ;
@@ -110,11 +106,10 @@ pub fn run(
110106 minus = m. to_string ( ) ;
111107 }
112108
113- if system != "latn" {
114- if let Some ( digits) = system_digit_map. get ( system) {
109+ if system != "latn"
110+ && let Some ( digits) = system_digit_map. get ( system) {
115111 digit_set_str = format ! ( "Some({:?})" , digits) ;
116112 }
117- }
118113
119114 let format_key = format ! ( "decimalFormats-numberSystem-{}" , system) ;
120115 if let Some ( pattern) = numbers[ format_key] [ "standard" ] . as_str ( ) {
0 commit comments