File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ impl FormatService {
4444 fn process_entry ( & self , entry : & WalkEntry , tx_error : & DiagnosticSender ) {
4545 let start_time = Instant :: now ( ) ;
4646
47- let path = Path :: new ( & entry. path ) ;
47+ let path = & entry. path ;
4848 let source_type = enable_jsx_source_type ( entry. source_type ) ;
4949
5050 // TODO: Use `read_to_arena_str()` like `oxlint`?
@@ -69,7 +69,7 @@ impl FormatService {
6969 & source_text,
7070 ret. errors ,
7171 ) ;
72- tx_error. send ( ( path. to_path_buf ( ) , diagnostics) ) . unwrap ( ) ;
72+ tx_error. send ( ( path. clone ( ) , diagnostics) ) . unwrap ( ) ;
7373 return ;
7474 }
7575
@@ -106,7 +106,7 @@ impl FormatService {
106106 ) ) ) ,
107107 _ => None ,
108108 } {
109- tx_error. send ( ( path. to_path_buf ( ) , vec ! [ diagnostic. into( ) ] ) ) . unwrap ( ) ;
109+ tx_error. send ( ( path. clone ( ) , vec ! [ diagnostic. into( ) ] ) ) . unwrap ( ) ;
110110 }
111111 }
112112}
Original file line number Diff line number Diff line change 1- use std:: { ffi:: OsStr , path:: PathBuf , sync:: Arc , sync :: mpsc} ;
1+ use std:: { ffi:: OsStr , path:: PathBuf , sync:: mpsc} ;
22
33use ignore:: overrides:: Override ;
44
@@ -58,7 +58,7 @@ impl Walk {
5858}
5959
6060pub struct WalkEntry {
61- pub path : Arc < OsStr > ,
61+ pub path : PathBuf ,
6262 pub source_type : SourceType ,
6363}
6464
@@ -112,8 +112,7 @@ impl ignore::ParallelVisitor for WalkVisitor {
112112 }
113113
114114 if let Some ( source_type) = get_supported_source_type ( entry. path ( ) ) {
115- let walk_entry =
116- WalkEntry { path : entry. path ( ) . as_os_str ( ) . into ( ) , source_type } ;
115+ let walk_entry = WalkEntry { path : entry. path ( ) . to_path_buf ( ) , source_type } ;
117116 // Send each entry immediately through the channel
118117 // If send fails, the receiver has been dropped, so stop walking
119118 if self . sender . send ( walk_entry) . is_err ( ) {
You can’t perform that action at this time.
0 commit comments