File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 11use scanner_core:: * ;
22use std:: fs;
3- use std:: path:: PathBuf ;
3+ use std:: path:: { Path , PathBuf } ;
44use std:: sync:: Arc ;
55use std:: time:: { SystemTime , UNIX_EPOCH } ;
66
7- fn write_file ( dir : & PathBuf , rel : & str , contents : & str ) {
7+ fn write_file ( dir : & Path , rel : & str , contents : & str ) {
88 let path = dir. join ( rel) ;
99 if let Some ( parent) = path. parent ( ) {
1010 fs:: create_dir_all ( parent) . unwrap ( ) ;
Original file line number Diff line number Diff line change 11use scanner_core:: * ;
22use std:: fs;
3- use std:: path:: PathBuf ;
3+ use std:: path:: { Path , PathBuf } ;
44use std:: sync:: Arc ;
55use std:: time:: { SystemTime , UNIX_EPOCH } ;
66
7- fn write_file ( dir : & PathBuf , rel : & str , contents : & str ) {
7+ fn write_file ( dir : & Path , rel : & str , contents : & str ) {
88 let path = dir. join ( rel) ;
99 if let Some ( parent) = path. parent ( ) {
1010 fs:: create_dir_all ( parent) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -1016,13 +1016,11 @@ impl PatternDetector {
10161016 last_api = Some ( ( m. start ( ) , re. as_str ( ) . to_string ( ) ) ) ;
10171017 }
10181018 }
1019- if api_hits > 0 {
1020- if first_symbol. is_empty ( ) {
1021- if let Some ( ( pos, sym) ) = last_api. clone ( ) {
1022- first_span = index. to_line_col ( pos) ;
1023- first_symbol = sym;
1024- first_snippet = extract_line ( stripped_s, pos) ;
1025- }
1019+ if api_hits > 0 && first_symbol. is_empty ( ) {
1020+ if let Some ( ( pos, sym) ) = last_api. clone ( ) {
1021+ first_span = index. to_line_col ( pos) ;
1022+ first_symbol = sym;
1023+ first_snippet = extract_line ( stripped_s, pos) ;
10261024 }
10271025 }
10281026 // Require anchor only if patterns define any; always require at least one API hit
You can’t perform that action at this time.
0 commit comments