File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -435,11 +435,12 @@ impl<'a> FnIrBuilder<'a> {
435435
436436 let mut ctx = FragmentCtx :: new ( self , params, generic_names) ;
437437 for child in stmt_list. syntax ( ) . children_with_tokens ( ) {
438- if let ra_ap_syntax:: NodeOrToken :: Token ( ref t) = child
439- && ( t. kind ( ) == SyntaxKind :: L_CURLY || t. kind ( ) == SyntaxKind :: R_CURLY )
440- && t. parent ( ) . as_ref ( ) == Some ( stmt_list. syntax ( ) )
441- {
442- continue ;
438+ if let ra_ap_syntax:: NodeOrToken :: Token ( ref t) = child {
439+ if ( t. kind ( ) == SyntaxKind :: L_CURLY || t. kind ( ) == SyntaxKind :: R_CURLY )
440+ && t. parent ( ) . as_ref ( ) == Some ( stmt_list. syntax ( ) )
441+ {
442+ continue ;
443+ }
443444 }
444445 ctx. visit ( child) ;
445446 }
Original file line number Diff line number Diff line change @@ -14,11 +14,10 @@ fn main() {
1414 // Collect all tgt_*.rs files
1515 let mut files = Vec :: new ( ) ;
1616 visit ( & crate_root, & mut |p| {
17- if let Some ( name) = p. file_name ( ) . and_then ( |s| s. to_str ( ) )
18- && name. starts_with ( "tgt_" )
19- && name. ends_with ( ".rs" )
20- {
21- files. push ( p. to_path_buf ( ) ) ;
17+ if let Some ( name) = p. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
18+ if name. starts_with ( "tgt_" ) && name. ends_with ( ".rs" ) {
19+ files. push ( p. to_path_buf ( ) ) ;
20+ }
2221 }
2322 } ) ;
2423 files. sort ( ) ;
@@ -42,7 +41,9 @@ fn main() {
4241 . to_string_lossy ( )
4342 . replace ( '\\' , "/" )
4443 . trim_start_matches ( "./" )
45- . replace ( [ '/' , '.' , '-' ] , "_" ) ;
44+ . replace ( '/' , "_" )
45+ . replace ( '.' , "_" )
46+ . replace ( '-' , "_" ) ;
4647
4748 if let Some ( stripped) = module_name. strip_suffix ( "_rs" ) {
4849 module_name = stripped. to_string ( ) ;
You can’t perform that action at this time.
0 commit comments