Confused about my own explanation.

This commit is contained in:
daxpedda 2021-02-06 18:29:07 +01:00
parent ea0b8324d6
commit fd8b5fa1aa
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F

View file

@ -93,7 +93,8 @@ 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 = []`)
// only run the lint if publish is `None` (`publish = true` or skipped entirely)
// or if the vector isn't empty (`publish = ["something"]`)
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");