diff --git a/src/cargo/ops/vendor.rs b/src/cargo/ops/vendor.rs index 4413786feb2..176d6de59e3 100644 --- a/src/cargo/ops/vendor.rs +++ b/src/cargo/ops/vendor.rs @@ -133,7 +133,7 @@ fn sync( continue; } if let Ok(pkg) = packages.get_one(pkg) { - drop(fs::remove_dir_all(pkg.manifest_path().parent().unwrap())); + drop(fs::remove_dir_all(pkg.root())); } } } @@ -192,10 +192,7 @@ fn sync( let mut tmp_buf = [0; 64 * 1024]; for (id, pkg) in ids.iter() { // Next up, copy it to the vendor directory - let src = pkg - .manifest_path() - .parent() - .expect("manifest_path should point to a file"); + let src = pkg.root(); let max_version = *versions[&id.name()].iter().rev().next().unwrap().0; let dir_has_version_suffix = opts.versioned_dirs || id.version() != max_version; let dst_name = if dir_has_version_suffix { @@ -329,7 +326,7 @@ fn cp_sources( // the time and if we respect them (e.g. in git) then it'll // probably mess with the checksums when a vendor dir is checked // into someone else's source control - Some(".gitattributes") | Some(".gitignore") | Some(".git") => continue, + Some(".gitattributes" | ".gitignore" | ".git") => continue, // Temporary Cargo files Some(".cargo-ok") => continue,