]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Rename misleading function
authorJoshua Nelson <jyn514@gmail.com>
Sat, 18 Jul 2020 20:48:59 +0000 (16:48 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Sat, 22 Aug 2020 04:22:43 +0000 (00:22 -0400)
- `is_associated` -> `is_type_alias`

`is_associated` is not a good name for what this is doing. If you look at
https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296,
is_associated() and as_assoc_kind() do completely different things, but
from the name it sounds like they're similar.

src/librustdoc/clean/types.rs
src/librustdoc/html/render/mod.rs

index 3eac5bbda007898b9c5f31a3df2e2ba0037d2049..4640b4ebf46499e57052b666d3d8499d9477e753 100644 (file)
@@ -282,7 +282,7 @@ pub enum ItemEnum {
 }
 
 impl ItemEnum {
-    pub fn is_associated(&self) -> bool {
+    pub fn is_type_alias(&self) -> bool {
         match *self {
             ItemEnum::TypedefItem(_, _) | ItemEnum::AssocTypeItem(_, _) => true,
             _ => false,
index bd919205dd1761b76c9cd010df00fbd57cc5f1af..d17961521c87d33f14b2899a8f2bd13978dbcf3d 100644 (file)
@@ -3612,7 +3612,7 @@ fn doc_impl_item(
         };
 
         let (is_hidden, extra_class) =
-            if (trait_.is_none() || item.doc_value().is_some() || item.inner.is_associated())
+            if (trait_.is_none() || item.doc_value().is_some() || item.inner.is_type_alias())
                 && !is_default_item
             {
                 (false, "")