File tree 1 file changed +3
-6
lines changed
src/tools/rust-analyzer/crates/proc-macro-srv/src
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>
199
199
to. push ( "rust-analyzer-proc-macros" ) ;
200
200
_ = fs:: create_dir ( & to) ;
201
201
202
- let file_name = path. file_name ( ) . ok_or_else ( || {
202
+ let file_name = path. file_stem ( ) . ok_or_else ( || {
203
203
io:: Error :: new ( io:: ErrorKind :: InvalidInput , format ! ( "File path is invalid: {path}" ) )
204
204
} ) ?;
205
205
206
206
to. push ( {
207
207
// Generate a unique number by abusing `HashMap`'s hasher.
208
208
// 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" )
214
211
} ) ;
215
212
fs:: copy ( path, & to) ?;
216
213
Ok ( to)
You can’t perform that action at this time.
0 commit comments