summaryrefslogtreecommitdiff
path: root/cli/tools/vendor/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/vendor/test.rs')
-rw-r--r--cli/tools/vendor/test.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs
index 61c885731..7171b8463 100644
--- a/cli/tools/vendor/test.rs
+++ b/cli/tools/vendor/test.rs
@@ -242,7 +242,7 @@ impl VendorTestBuilder {
let import_map = files.remove(&output_dir.join("import_map.json"));
let mut files = files
.iter()
- .map(|(path, text)| (path_to_string(path), text.clone()))
+ .map(|(path, text)| (path_to_string(path), text.to_string()))
.collect::<Vec<_>>();
files.sort_by(|a, b| a.0.cmp(&b.0));
@@ -293,7 +293,11 @@ fn make_path(text: &str) -> PathBuf {
}
}
-fn path_to_string(path: &Path) -> String {
+fn path_to_string<P>(path: P) -> String
+where
+ P: AsRef<Path>,
+{
+ let path = path.as_ref();
// inverse of the function above
let path = path.to_string_lossy();
if cfg!(windows) {