refactor(resolve): Abstract out MSRV policy tracking

This commit is contained in:
Ed Page 2024-04-11 12:07:05 -05:00
parent 789eda2b83
commit 11448b44fe
2 changed files with 5 additions and 1 deletions

View File

@ -605,6 +605,10 @@ impl<'gctx> Workspace<'gctx> {
self.members().filter_map(|pkg| pkg.rust_version()).min()
}
pub fn resolve_honors_rust_version(&self) -> bool {
self.gctx().cli_unstable().msrv_policy
}
pub fn custom_metadata(&self) -> Option<&toml::Value> {
self.custom_metadata.as_ref()
}

View File

@ -323,7 +323,7 @@ pub fn resolve_with_previous<'gctx>(
if ws.gctx().cli_unstable().minimal_versions {
version_prefs.version_ordering(VersionOrdering::MinimumVersionsFirst)
}
if ws.gctx().cli_unstable().msrv_policy {
if ws.resolve_honors_rust_version() {
version_prefs.max_rust_version(ws.rust_version().cloned().map(RustVersion::into_partial));
}