Skip to content

Commit

Permalink
Remove metadata merging check
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Apr 17, 2024
1 parent 4dd3484 commit 10cf15c
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/internal/incompatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> Incompatibilit
if dep_term != other.get(p2) {
return None;
}
// The metadata must be identical to merge
let self_metadata = self.metadata();
if self_metadata != other.metadata() {
return None;
}
return Some(Self::from_dependency(
p1.clone(),
self.get(p1)
Expand Down Expand Up @@ -304,16 +299,6 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> Incompatibilit
)),
}
}

fn metadata(&self) -> Option<&M> {
match &self.kind {
Kind::NotRoot(_, _)
| Kind::NoVersions(_, _)
| Kind::FromDependencyOf(_, _, _, _)
| Kind::DerivedFrom(_, _) => None,
Kind::Custom(_, _, metadata) => Some(metadata),
}
}
}

impl<'a, P: Package, VS: VersionSet + 'a, M: Eq + Clone + Debug + Display + 'a>
Expand Down Expand Up @@ -384,12 +369,12 @@ pub mod tests {
let mut store = Arena::new();
let i1 = store.alloc(Incompatibility {
package_terms: SmallMap::Two([("p1", t1.clone()), ("p2", t2.negate())]),
kind: Kind::Custom("0", Range::full(), "foo".to_string())
kind: Kind::<_, _, String>::FromDependencyOf("p1", Range::full(), "p2", Range::full())
});

let i2 = store.alloc(Incompatibility {
package_terms: SmallMap::Two([("p2", t2), ("p3", t3.clone())]),
kind: Kind::Custom("0", Range::full(), "bar".to_string())
kind: Kind::<_, _, String>::FromDependencyOf("p2", Range::full(), "p3", Range::full())
});

let mut i3 = Map::default();
Expand Down

0 comments on commit 10cf15c

Please sign in to comment.