mirror of https://github.com/rust-lang/cargo
refactor(resolve): Pull put locking message
This commit is contained in:
parent
17a11e493c
commit
cb2bdea521
|
@ -212,9 +212,7 @@ fn print_lockfile_generation(
|
|||
// just ourself, nothing worth reporting
|
||||
return Ok(());
|
||||
}
|
||||
ws.gctx()
|
||||
.shell()
|
||||
.status("Locking", format!("{num_pkgs} packages"))?;
|
||||
status_locking(ws, num_pkgs)?;
|
||||
|
||||
for diff in diff {
|
||||
fn format_latest(version: semver::Version) -> String {
|
||||
|
@ -271,10 +269,7 @@ fn print_lockfile_sync(
|
|||
if num_pkgs == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
let plural = if num_pkgs == 1 { "" } else { "s" };
|
||||
ws.gctx()
|
||||
.shell()
|
||||
.status("Locking", format!("{num_pkgs} package{plural}"))?;
|
||||
status_locking(ws, num_pkgs)?;
|
||||
|
||||
for diff in diff {
|
||||
fn format_latest(version: semver::Version) -> String {
|
||||
|
@ -488,6 +483,14 @@ fn print_lockfile_updates(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn status_locking(ws: &Workspace<'_>, num_pkgs: usize) -> CargoResult<()> {
|
||||
let plural = if num_pkgs == 1 { "" } else { "s" };
|
||||
ws.gctx()
|
||||
.shell()
|
||||
.status("Locking", format!("{num_pkgs} package{plural}"))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn is_latest(candidate: &semver::Version, current: &semver::Version) -> bool {
|
||||
current < candidate
|
||||
// Only match pre-release if major.minor.patch are the same
|
||||
|
|
Loading…
Reference in New Issue