Skip to content

Commit

Permalink
Reduce diff a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed May 8, 2024
1 parent ffce939 commit 0e684a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/internal/incompatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> Incompatibilit
DerivationTree::External(External::NotRoot(package, version))
}
Kind::NoVersions(package, set) => {
DerivationTree::External(External::NoVersions(package.clone(), set.clone(), None))
DerivationTree::External(External::NoVersions(package.clone(), set.clone()))
}
Kind::FromDependencyOf(package, set, dep_package, dep_set) => {
DerivationTree::External(External::FromDependencyOf(
Expand Down Expand Up @@ -354,12 +354,10 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> fmt::Display

#[cfg(test)]
pub mod tests {
use proptest::prelude::*;

use super::*;
use crate::range::Range;
use crate::term::tests::strategy as term_strat;

use super::*;
use proptest::prelude::*;

proptest! {

Expand All @@ -375,12 +373,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
2 changes: 1 addition & 1 deletion src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> DerivationTree
panic!("How did we end up with a NoVersions merged with a NotRoot?")
}
// Cannot be merged because the reason may not match
DerivationTree::External(External::NoVersions(_, _, _)) => None,
DerivationTree::External(External::NoVersions(_, _)) => None,
DerivationTree::External(External::Custom(_, r, reason)) => Some(
DerivationTree::External(External::Custom(package, set.union(&r), reason)),
),
Expand Down

0 comments on commit 0e684a8

Please sign in to comment.