Improve error messages when there are no versions of a singleton range (#855)

This commit is contained in:
Zanie Blue 2024-01-09 15:09:52 -06:00 committed by GitHub
parent 33982efb25
commit 34d548de21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -34,6 +34,8 @@ impl ReportFormatter<PubGrubPackage, Range<PubGrubVersion>> for PubGrubReportFor
let set = self.simplify_set(set, package);
if set.as_ref() == &Range::full() {
format!("there are no versions of {package}")
} else if set.as_singleton().is_some() {
format!("there is no version of {package}{set}")
} else {
format!("there are no versions of {package}{set}")
}