mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-14 01:32:24 +00:00
Remove uses of Option<MarkerTree> (#5978)
## Summary Follow up to https://github.com/astral-sh/uv/pull/5898. This should fix some of the failures in https://github.com/astral-sh/uv/pull/5887 where `uv lock --locked` is failing due to `Some(true)` and `None` markers not comparing equal.
This commit is contained in:
parent
4eced1bd0c
commit
f5110f7b5e
45 changed files with 228 additions and 330 deletions
|
|
@ -60,11 +60,7 @@ impl Constraints {
|
|||
|
||||
// ASSUMPTION: There is one `extra = "..."`, and it's either the only marker or part
|
||||
// of the main conjunction.
|
||||
let Some(extra_expression) = requirement
|
||||
.marker
|
||||
.as_ref()
|
||||
.and_then(MarkerTree::top_level_extra)
|
||||
else {
|
||||
let Some(extra_expression) = requirement.marker.top_level_extra() else {
|
||||
// Case 2: A non-optional dependency with constraint(s).
|
||||
return Either::Right(Either::Right(
|
||||
std::iter::once(requirement).chain(constraints.iter().map(Cow::Borrowed)),
|
||||
|
|
@ -79,11 +75,9 @@ impl Constraints {
|
|||
constraints.iter().cloned().map(move |constraint| {
|
||||
// Add the extra to the override marker.
|
||||
let mut joint_marker = MarkerTree::expression(extra_expression.clone());
|
||||
if let Some(marker) = &constraint.marker {
|
||||
joint_marker.and(marker.clone());
|
||||
}
|
||||
joint_marker.and(constraint.marker.clone());
|
||||
Cow::Owned(Requirement {
|
||||
marker: Some(joint_marker.clone()),
|
||||
marker: joint_marker,
|
||||
..constraint
|
||||
})
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue