diff options
| author | daxpedda <daxpedda@gmail.com> | 2021-02-06 18:29:07 +0100 |
|---|---|---|
| committer | daxpedda <daxpedda@gmail.com> | 2021-02-06 18:29:07 +0100 |
| commit | fd8b5fa1aa614dcfd21471ab5a9a56c7873ce14a (patch) | |
| tree | 5e22f5d24a7a1bdfb2740b74057e6090693b02db | |
| parent | ea0b8324d6457c4a380a6c30e41414f863ff7897 (diff) | |
| download | rust-fd8b5fa1aa614dcfd21471ab5a9a56c7873ce14a.tar.gz rust-fd8b5fa1aa614dcfd21471ab5a9a56c7873ce14a.zip | |
Confused about my own explanation.
| -rw-r--r-- | clippy_lints/src/cargo_common_metadata.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/cargo_common_metadata.rs b/clippy_lints/src/cargo_common_metadata.rs index 12cbaea26cd..cc2869ab495 100644 --- a/clippy_lints/src/cargo_common_metadata.rs +++ b/clippy_lints/src/cargo_common_metadata.rs @@ -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"); |
