Document condition.

This commit is contained in:
daxpedda 2021-02-06 18:24:08 +01:00
parent 3c8f7542f7
commit ea0b8324d6
No known key found for this signature in database
GPG Key ID: 43D62A3EA388E46F

View File

@ -93,6 +93,7 @@ impl LateLintPass<'_> for CargoCommonMetadata {
let metadata = unwrap_cargo_metadata!(cx, CARGO_COMMON_METADATA, false);
for package in metadata.packages {
// we want to skip the lint if publish is `None` (`publish = false`) or if the vector is empty (`publish = []`)
if package.publish.as_ref().filter(|publish| publish.is_empty()).is_none() || self.ignore_publish {
if is_empty_vec(&package.authors) {
missing_warning(cx, &package, "package.authors");