]> git.lizzy.rs Git - rust.git/commitdiff
Confused about my own explanation.
authordaxpedda <daxpedda@gmail.com>
Sat, 6 Feb 2021 17:29:07 +0000 (18:29 +0100)
committerdaxpedda <daxpedda@gmail.com>
Sat, 6 Feb 2021 17:29:07 +0000 (18:29 +0100)
clippy_lints/src/cargo_common_metadata.rs

index 12cbaea26cd321b17004d7de9b8277d7519629c1..cc2869ab495c8ab9245d66d9503ffdbc0f44a94e 100644 (file)
@@ -93,7 +93,8 @@ fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
         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");