1- use std:: collections:: HashMap ;
2-
31use criterion:: { black_box, criterion_group, criterion_main, Criterion } ;
42
53use codelens_core:: analyzer:: counter:: count_stats;
@@ -15,7 +13,8 @@ fn make_rust_lang() -> Language {
1513 block_comments = [["/*", "*/"]]
1614 nested_comments = true
1715 "# ;
18- let langs: std:: collections:: HashMap < String , Language > = toml:: from_str ( toml) . unwrap ( ) ;
16+ let langs: std:: collections:: HashMap < String , Language > =
17+ toml:: from_str ( toml) . unwrap ( ) ;
1918 langs. into_values ( ) . next ( ) . unwrap ( )
2019}
2120
@@ -27,12 +26,12 @@ fn generate_rust_code(lines: usize) -> String {
2726 1 => code. push_str ( "fn some_function() {\n " ) ,
2827 2 => code. push_str ( " let x = \" hello world\" ;\n " ) ,
2928 3 => code. push_str ( " /* inline block comment */\n " ) ,
30- 4 => code. push_str ( " \n " ) ,
29+ 4 => code. push ( '\n' ) ,
3130 5 => code. push_str ( " if x > 0 {\n " ) ,
3231 6 => code. push_str ( " println!(\" value: {}\" , x);\n " ) ,
3332 7 => code. push_str ( " }\n " ) ,
3433 8 => code. push_str ( "}\n " ) ,
35- _ => code. push_str ( " \n " ) ,
34+ _ => code. push ( '\n' ) ,
3635 }
3736 }
3837 code
0 commit comments