File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
src/tools/rust-analyzer/crates/proc-macro-srv/src Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -199,18 +199,15 @@ fn ensure_file_with_lock_free_access(path: &Utf8Path) -> io::Result<Utf8PathBuf>
199199 to. push ( "rust-analyzer-proc-macros" ) ;
200200 _ = fs:: create_dir ( & to) ;
201201
202- let file_name = path. file_name ( ) . ok_or_else ( || {
202+ let file_name = path. file_stem ( ) . ok_or_else ( || {
203203 io:: Error :: new ( io:: ErrorKind :: InvalidInput , format ! ( "File path is invalid: {path}" ) )
204204 } ) ?;
205205
206206 to. push ( {
207207 // Generate a unique number by abusing `HashMap`'s hasher.
208208 // Maybe this will also "inspire" a libs team member to finally put `rand` in libstd.
209- let t = RandomState :: new ( ) . build_hasher ( ) . finish ( ) ;
210- let mut unique_name = t. to_string ( ) ;
211- unique_name. push_str ( file_name) ;
212- unique_name. push ( '-' ) ;
213- unique_name
209+ let unique_name = RandomState :: new ( ) . build_hasher ( ) . finish ( ) ;
210+ format ! ( "{file_name}-{unique_name}.dll" )
214211 } ) ;
215212 fs:: copy ( path, & to) ?;
216213 Ok ( to)
You can’t perform that action at this time.
0 commit comments