Skip to content

Commit

Permalink
Improve handling of empty sets in reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Nov 28, 2023
1 parent bbceb72 commit 53c9f6d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ impl<P: Package, VS: VersionSet> fmt::Display for External<P, VS> {
write!(f, "we are solving dependencies of {} {}", package, version)
}
Self::NoVersions(package, set) => {
if set == &VS::full() {
if set == &VS::full() || set == &VS::empty() {
write!(f, "there is no available version for {}", package)
} else {
write!(f, "there is no version of {} in {}", package, set)
}
}
Self::UnavailableDependencies(package, set) => {
if set == &VS::full() {
if set == &VS::full() || set == &VS::empty() {
write!(f, "dependencies of {} are unavailable", package)
} else {
write!(
Expand All @@ -208,11 +208,13 @@ impl<P: Package, VS: VersionSet> fmt::Display for External<P, VS> {
}
}
Self::FromDependencyOf(p, set_p, dep, set_dep) => {
if set_p == &VS::full() && set_dep == &VS::full() {
if (set_p == &VS::full() || set_p == &VS::empty())
&& (set_dep == &VS::full() || set_dep == &VS::empty())
{
write!(f, "{} depends on {}", p, dep)
} else if set_p == &VS::full() {
} else if set_p == &VS::full() || set_p == &VS::empty() {
write!(f, "{} depends on {} {}", p, dep, set_dep)
} else if set_dep == &VS::full() {
} else if set_dep == &VS::full() || set_dep == &VS::empty() {
write!(f, "{} {} depends on {}", p, set_p, dep)
} else {
write!(f, "{} {} depends on {} {}", p, set_p, dep, set_dep)
Expand Down

0 comments on commit 53c9f6d

Please sign in to comment.