Skip to content

Commit 9ed252c

Browse files
zaniebkonstin
authored andcommitted
Consolidate UnusableDependencies into a generic Unavailable incompatibility (#20)
* Consolidate `UnusableDependencies` into a generic `Unavailable` incompatibility * Docs
1 parent edc4429 commit 9ed252c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/internal/incompatibility.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> Incompatibilit
138138
}
139139
}
140140

141-
/// Create an incompatibility to remember
142-
/// that a package version is not selectable
143-
/// because its dependencies are not usable.
144-
pub fn unusable_dependencies(package: P, version: VS::V, reason: M) -> Self {
145-
let set = VS::singleton(version);
146-
Self {
147-
package_terms: SmallMap::One([(package.clone(), Term::Positive(set.clone()))]),
148-
kind: Kind::Custom(package, set, reason),
149-
}
150-
}
151-
152141
/// Build an incompatibility from a given dependency.
153142
pub fn from_dependency(package: P, versions: VS, dep: (&P, &VS)) -> Self {
154143
let (p2, set2) = dep;
@@ -383,12 +372,12 @@ pub mod tests {
383372
let mut store = Arena::new();
384373
let i1 = store.alloc(Incompatibility {
385374
package_terms: SmallMap::Two([("p1", t1.clone()), ("p2", t2.negate())]),
386-
kind: Kind::<_, _, String>::FromDependencyOf("p1", Range::full(), "p2", Range::full())
375+
kind: Kind::Custom("0", Range::full(), "foo".to_string())
387376
});
388377

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

394383
let mut i3 = Map::default();

0 commit comments

Comments
 (0)