@@ -35,11 +35,10 @@ pub enum DerivationTree<P: Package, V: Version> {
3535/// they have their own reason.
3636#[ derive( Debug , Clone ) ]
3737pub enum External < P : Package , V : Version > {
38- /// Initial incompatibility aiming at picking the root package
39- /// for the first decision.
38+ /// Initial incompatibility aiming at picking the root package for the first decision.
4039 NotRoot ( P , V ) ,
41- /// No version exist in that range .
42- NoVersion ( P , Range < V > ) ,
40+ /// No versions from range satisfy given constraints .
41+ NoVersions ( P , Range < V > ) ,
4342 /// Dependencies of the package are unavailable for versions in that range.
4443 UnavailableDependencies ( P , Range < V > ) ,
4544 /// Incompatibility coming from the dependencies of a given package.
@@ -64,52 +63,52 @@ pub struct Derived<P: Package, V: Version> {
6463}
6564
6665impl < P : Package , V : Version > DerivationTree < P , V > {
67- /// Merge the [NoVersion ](External::NoVersion ) external incompatibilities
66+ /// Merge the [NoVersions ](External::NoVersions ) external incompatibilities
6867 /// with the other one they are matched with
6968 /// in a derived incompatibility.
7069 /// This cleans up quite nicely the generated report.
7170 /// You might want to do this if you know that the
7271 /// [DependencyProvider](crate::solver::DependencyProvider)
7372 /// was not run in some kind of offline mode that may not
7473 /// have access to all versions existing.
75- pub fn collapse_noversion ( & mut self ) {
74+ pub fn collapse_no_versions ( & mut self ) {
7675 match self {
7776 DerivationTree :: External ( _) => { }
7877 DerivationTree :: Derived ( derived) => {
7978 match ( & mut * derived. cause1 , & mut * derived. cause2 ) {
80- ( DerivationTree :: External ( External :: NoVersion ( p, r) ) , ref mut cause2) => {
81- cause2. collapse_noversion ( ) ;
79+ ( DerivationTree :: External ( External :: NoVersions ( p, r) ) , ref mut cause2) => {
80+ cause2. collapse_no_versions ( ) ;
8281 * self = cause2
8382 . clone ( )
84- . merge_noversion ( p. to_owned ( ) , r. to_owned ( ) )
83+ . merge_no_versions ( p. to_owned ( ) , r. to_owned ( ) )
8584 . unwrap_or_else ( || self . to_owned ( ) ) ;
8685 }
87- ( ref mut cause1, DerivationTree :: External ( External :: NoVersion ( p, r) ) ) => {
88- cause1. collapse_noversion ( ) ;
86+ ( ref mut cause1, DerivationTree :: External ( External :: NoVersions ( p, r) ) ) => {
87+ cause1. collapse_no_versions ( ) ;
8988 * self = cause1
9089 . clone ( )
91- . merge_noversion ( p. to_owned ( ) , r. to_owned ( ) )
90+ . merge_no_versions ( p. to_owned ( ) , r. to_owned ( ) )
9291 . unwrap_or_else ( || self . to_owned ( ) ) ;
9392 }
9493 _ => {
95- derived. cause1 . collapse_noversion ( ) ;
96- derived. cause2 . collapse_noversion ( ) ;
94+ derived. cause1 . collapse_no_versions ( ) ;
95+ derived. cause2 . collapse_no_versions ( ) ;
9796 }
9897 }
9998 }
10099 }
101100 }
102101
103- fn merge_noversion ( self , package : P , range : Range < V > ) -> Option < Self > {
102+ fn merge_no_versions ( self , package : P , range : Range < V > ) -> Option < Self > {
104103 match self {
105104 // TODO: take care of the Derived case.
106105 // Once done, we can remove the Option.
107106 DerivationTree :: Derived ( _) => Some ( self ) ,
108107 DerivationTree :: External ( External :: NotRoot ( _, _) ) => {
109- panic ! ( "How did we end up with a NoVersion merged with a NotRoot?" )
108+ panic ! ( "How did we end up with a NoVersions merged with a NotRoot?" )
110109 }
111- DerivationTree :: External ( External :: NoVersion ( _, r) ) => Some ( DerivationTree :: External (
112- External :: NoVersion ( package, range. union ( & r) ) ,
110+ DerivationTree :: External ( External :: NoVersions ( _, r) ) => Some ( DerivationTree :: External (
111+ External :: NoVersions ( package, range. union ( & r) ) ,
113112 ) ) ,
114113 DerivationTree :: External ( External :: UnavailableDependencies ( _, r) ) => {
115114 Some ( DerivationTree :: External ( External :: UnavailableDependencies (
@@ -144,7 +143,7 @@ impl<P: Package, V: Version> fmt::Display for External<P, V> {
144143 Self :: NotRoot ( package, version) => {
145144 write ! ( f, "we are solving dependencies of {} {}" , package, version)
146145 }
147- Self :: NoVersion ( package, range) => {
146+ Self :: NoVersions ( package, range) => {
148147 if range == & Range :: any ( ) {
149148 write ! ( f, "there is no available version for {}" , package)
150149 } else {
0 commit comments