@@ -291,7 +291,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
291291 \x20 .filter(|(_, count)| **count > 0)\n \
292292 \x20 .map(|(idx, count)| (Self::from_index(idx), *count))\n \
293293 \x20 .collect();\n \
294- \x20 langs.sort_by(|a, b| b.1. cmp(&a .1));\n \
294+ \x20 langs.sort_by_key(|x| ::std:: cmp::Reverse(x .1));\n \
295295 \x20 langs.into_iter().map(|(lang, _)| lang).collect()\n \
296296 \x20 }\n \n \
297297 \x20 /// Count files per language in the project.\n \
@@ -373,7 +373,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
373373 ) ;
374374 for def in defs {
375375 if !def. grammar . aliases . is_empty ( ) {
376- code. push_str ( & format ! ( " \" {}\" => match file_ext {{\n " , def. name, ) ) ;
376+ code. push_str ( & format ! ( " \" {}\" => match file_ext {{\n " , def. name) ) ;
377377 for alias in & def. grammar . aliases {
378378 let ext_patterns: Vec < String > = alias
379379 . for_extensions
@@ -429,7 +429,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
429429 if let Some ( ref builtin) = def. builtin
430430 && let Some ( ref extractor) = builtin. dep_extractor
431431 {
432- code. push_str ( & format ! ( " {} => Some(\" {}\" ),\n " , i, extractor, ) ) ;
432+ code. push_str ( & format ! ( " {} => Some(\" {}\" ),\n " , i, extractor) ) ;
433433 }
434434 }
435435 code. push_str ( " _ => None,\n }\n }\n \n " ) ;
@@ -444,7 +444,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
444444 if let Some ( ref builtin) = def. builtin
445445 && let Some ( ref extractor) = builtin. entity_extractor
446446 {
447- code. push_str ( & format ! ( " {} => Some(\" {}\" ),\n " , i, extractor, ) ) ;
447+ code. push_str ( & format ! ( " {} => Some(\" {}\" ),\n " , i, extractor) ) ;
448448 }
449449 }
450450 code. push_str ( " _ => None,\n }\n }\n " ) ;
0 commit comments