@@ -160,15 +160,15 @@ fn load_data() -> UnicodeData {
160160 . push ( Codepoints :: Single ( row. codepoint ) ) ;
161161 }
162162
163- if let Some ( mapped) = row. simple_lowercase_mapping {
164- if mapped != row. codepoint {
165- to_lower . insert ( row . codepoint . value ( ) , ( mapped . value ( ) , 0 , 0 ) ) ;
166- }
163+ if let Some ( mapped) = row. simple_lowercase_mapping
164+ && mapped != row. codepoint
165+ {
166+ to_lower . insert ( row . codepoint . value ( ) , ( mapped . value ( ) , 0 , 0 ) ) ;
167167 }
168- if let Some ( mapped) = row. simple_uppercase_mapping {
169- if mapped != row. codepoint {
170- to_upper . insert ( row . codepoint . value ( ) , ( mapped . value ( ) , 0 , 0 ) ) ;
171- }
168+ if let Some ( mapped) = row. simple_uppercase_mapping
169+ && mapped != row. codepoint
170+ {
171+ to_upper . insert ( row . codepoint . value ( ) , ( mapped . value ( ) , 0 , 0 ) ) ;
172172 }
173173 }
174174
@@ -196,12 +196,12 @@ fn load_data() -> UnicodeData {
196196 . flat_map ( |codepoints| match codepoints {
197197 Codepoints :: Single ( c) => c
198198 . scalar ( )
199- . map ( |ch| ( ch as u32 ..ch as u32 + 1 ) )
199+ . map ( |ch| ch as u32 ..ch as u32 + 1 )
200200 . into_iter ( )
201201 . collect :: < Vec < _ > > ( ) ,
202202 Codepoints :: Range ( c) => c
203203 . into_iter ( )
204- . flat_map ( |c| c. scalar ( ) . map ( |ch| ( ch as u32 ..ch as u32 + 1 ) ) )
204+ . flat_map ( |c| c. scalar ( ) . map ( |ch| ch as u32 ..ch as u32 + 1 ) )
205205 . collect :: < Vec < _ > > ( ) ,
206206 } )
207207 . collect :: < Vec < Range < u32 > > > ( ) ,
@@ -236,7 +236,7 @@ fn main() {
236236 let ranges_by_property = & unicode_data. ranges ;
237237
238238 if let Some ( path) = test_path {
239- std:: fs:: write ( & path, generate_tests ( & write_location, & ranges_by_property) ) . unwrap ( ) ;
239+ std:: fs:: write ( & path, generate_tests ( & write_location, ranges_by_property) ) . unwrap ( ) ;
240240 }
241241
242242 let mut total_bytes = 0 ;
@@ -246,9 +246,9 @@ fn main() {
246246
247247 let mut emitter = RawEmitter :: new ( ) ;
248248 if property == & "White_Space" {
249- emit_whitespace ( & mut emitter, & ranges) ;
249+ emit_whitespace ( & mut emitter, ranges) ;
250250 } else {
251- emit_codepoints ( & mut emitter, & ranges) ;
251+ emit_codepoints ( & mut emitter, ranges) ;
252252 }
253253
254254 modules. push ( ( property. to_lowercase ( ) . to_string ( ) , emitter. file ) ) ;
@@ -288,7 +288,7 @@ fn main() {
288288 for line in contents. lines ( ) {
289289 if !line. trim ( ) . is_empty ( ) {
290290 table_file. push_str ( " " ) ;
291- table_file. push_str ( & line) ;
291+ table_file. push_str ( line) ;
292292 }
293293 table_file. push ( '\n' ) ;
294294 }
@@ -312,15 +312,15 @@ fn version() -> String {
312312 let start = readme. find ( prefix) . unwrap ( ) + prefix. len ( ) ;
313313 let end = readme. find ( " of the Unicode Standard." ) . unwrap ( ) ;
314314 let version =
315- readme[ start..end] . split ( '.' ) . map ( |v| v. parse :: < u32 > ( ) . expect ( & v) ) . collect :: < Vec < _ > > ( ) ;
315+ readme[ start..end] . split ( '.' ) . map ( |v| v. parse :: < u32 > ( ) . expect ( v) ) . collect :: < Vec < _ > > ( ) ;
316316 let [ major, minor, micro] = [ version[ 0 ] , version[ 1 ] , version[ 2 ] ] ;
317317
318318 out. push_str ( & format ! ( "({major}, {minor}, {micro});\n " ) ) ;
319319 out
320320}
321321
322322fn fmt_list < V : std:: fmt:: Debug > ( values : impl IntoIterator < Item = V > ) -> String {
323- let pieces = values. into_iter ( ) . map ( |b| format ! ( "{:?}, " , b ) ) . collect :: < Vec < _ > > ( ) ;
323+ let pieces = values. into_iter ( ) . map ( |b| format ! ( "{b :?}, " ) ) . collect :: < Vec < _ > > ( ) ;
324324 let mut out = String :: new ( ) ;
325325 let mut line = String :: from ( "\n " ) ;
326326 for piece in pieces {
@@ -348,7 +348,7 @@ fn generate_tests(data_path: &str, ranges: &[(&str, Vec<Range<u32>>)]) -> String
348348 s. push_str ( "\n fn main() {\n " ) ;
349349
350350 for ( property, ranges) in ranges {
351- s. push_str ( & format ! ( r#" println!("Testing {}");"# , property ) ) ;
351+ s. push_str ( & format ! ( r#" println!("Testing {property }");"# ) ) ;
352352 s. push ( '\n' ) ;
353353 s. push_str ( & format ! ( " {}_true();\n " , property. to_lowercase( ) ) ) ;
354354 s. push_str ( & format ! ( " {}_false();\n " , property. to_lowercase( ) ) ) ;
@@ -373,7 +373,7 @@ fn generate_tests(data_path: &str, ranges: &[(&str, Vec<Range<u32>>)]) -> String
373373 s. push_str ( " }\n \n " ) ;
374374 }
375375
376- s. push_str ( "}" ) ;
376+ s. push ( '}' ) ;
377377 s
378378}
379379
@@ -388,7 +388,7 @@ fn generate_asserts(s: &mut String, property: &str, points: &[u32], truthy: bool
388388 range. start,
389389 ) ) ;
390390 } else {
391- s. push_str ( & format ! ( " for chn in {:?}u32 {{\n " , range ) ) ;
391+ s. push_str ( & format ! ( " for chn in {range :?}u32 {{\n " ) ) ;
392392 s. push_str ( & format ! (
393393 " assert!({}unicode_data::{}::lookup(std::char::from_u32(chn).unwrap()), \" {{:?}}\" , chn);\n " ,
394394 if truthy { "" } else { "!" } ,
@@ -439,7 +439,7 @@ fn merge_ranges(ranges: &mut Vec<Range<u32>>) {
439439 let mut last_end = None ;
440440 for range in ranges {
441441 if let Some ( last) = last_end {
442- assert ! ( range. start > last, "{:?}" , range ) ;
442+ assert ! ( range. start > last, "{range :?}" ) ;
443443 }
444444 last_end = Some ( range. end ) ;
445445 }
0 commit comments