Skip to content

Commit

Permalink
Resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bishtpawan committed Aug 5, 2020
1 parent 3952fdb commit 81687e7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/cargo/ops/common_for_install_and_uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,13 @@ where
Ok(pkg)
}
None => {
let version: String = dep.version_req().to_string();
let pkg_id;
if dep.version_req().is_exact() {
pkg_id = PackageId::new(dep.package_name(), &version[1..], source.source_id());
let is_yanked: bool = if dep.version_req().is_exact() {
let version: String = dep.version_req().to_string();
PackageId::new(dep.package_name(), &version[1..], source.source_id())
.map_or(false, |pkg_id| source.is_yanked(pkg_id).unwrap_or(false))
} else {
pkg_id = PackageId::new(dep.package_name(), &version[..], source.source_id());
}
let is_yanked =
pkg_id.map_or(false, |pkg_id| source.is_yanked(pkg_id).unwrap_or(false));
false
};
if is_yanked {
bail!(
"cannot install package `{}`, it has been yanked from {}",
Expand Down

0 comments on commit 81687e7

Please sign in to comment.