aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 7652166..f01804c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,9 +6,12 @@ use sha2::{Digest, Sha512_256};
use std::{
fs,
io::{self, Write},
- path::{self, PathBuf},
+ path::PathBuf,
};
+#[cfg(unix)]
+use std::path::absolute;
+
use embedders::*;
use tsp_approx::*;
mod embedders;
@@ -196,8 +199,7 @@ fn copy_into(tsp: &[PathBuf], target: &PathBuf, use_symlinks: bool) -> Result<()
#[cfg(unix)]
if use_symlinks {
- let rel_path =
- pathdiff::diff_paths(path::absolute(p)?, path::absolute(target)?).unwrap();
+ let rel_path = pathdiff::diff_paths(absolute(p)?, absolute(target)?).unwrap();
let _ = fs::remove_file(&tp);
std::os::unix::fs::symlink(rel_path, tp)?;
} else {