aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-04-25 05:48:59 +0100
committerEdwin Cheng <[email protected]>2020-04-26 10:17:37 +0100
commitfb996cae6bf5bb5f60176a4a190311d4363b3e10 (patch)
treec4789ec5cf9074af110385b59326540dc0a28ecc
parent3bad5587c8cd17cd7dfae9796c8a01f47307214f (diff)
Fix
-rw-r--r--crates/ra_proc_macro_srv/src/dylib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_proc_macro_srv/src/dylib.rs b/crates/ra_proc_macro_srv/src/dylib.rs
index 018cc7bb8..99c83481a 100644
--- a/crates/ra_proc_macro_srv/src/dylib.rs
+++ b/crates/ra_proc_macro_srv/src/dylib.rs
@@ -199,6 +199,7 @@ impl Expander {
199 } 199 }
200} 200}
201 201
202#[cfg(windows)]
202fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> { 203fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
203 let mut to = std::env::temp_dir(); 204 let mut to = std::env::temp_dir();
204 let file_name = path.file_name().ok_or_else(|| { 205 let file_name = path.file_name().ok_or_else(|| {
@@ -212,3 +213,8 @@ fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
212 std::fs::copy(path, &to)?; 213 std::fs::copy(path, &to)?;
213 Ok(to) 214 Ok(to)
214} 215}
216
217#[cfg(unix)]
218fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
219 Ok(path.to_path_buf())
220}