about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-09 15:40:56 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-25 15:05:56 +0200
commit5f857a9871240efe6e15ca94dd03e06b90c6413d (patch)
treed1249cd0fcddf6543d5275fb9fc7615104261f63
parentaa57e46e24a4a08cc336325e92567b40b0c2ba62 (diff)
downloadrust-5f857a9871240efe6e15ca94dd03e06b90c6413d.tar.gz
rust-5f857a9871240efe6e15ca94dd03e06b90c6413d.zip
Rename `clean::Enum::variants` method into `non_stripped_variants`
-rw-r--r--src/librustdoc/clean/types.rs2
-rw-r--r--src/librustdoc/html/render/print_item.rs2
-rw-r--r--src/librustdoc/html/render/sidebar.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 07ecd98f775..f353ad5cf91 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -2107,7 +2107,7 @@ impl Enum {
         self.variants.iter().any(|f| f.is_stripped())
     }
 
-    pub(crate) fn variants(&self) -> impl Iterator<Item = &Item> {
+    pub(crate) fn non_stripped_variants(&self) -> impl Iterator<Item = &Item> {
         self.variants.iter().filter(|v| !v.is_stripped())
     }
 }
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 39a631b637b..552e67c9f53 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -1535,7 +1535,7 @@ fn print_tuple_struct_fields(cx: &Context<'_>, s: &[clean::Item]) -> impl Displa
 
 fn item_enum(cx: &Context<'_>, it: &clean::Item, e: &clean::Enum) -> impl fmt::Display {
     fmt::from_fn(|w| {
-        let count_variants = e.variants().count();
+        let count_variants = e.non_stripped_variants().count();
         wrap_item(w, |w| {
             render_attributes_in_code(w, it, cx);
             write!(
diff --git a/src/librustdoc/html/render/sidebar.rs b/src/librustdoc/html/render/sidebar.rs
index 361966325fb..91540e06e33 100644
--- a/src/librustdoc/html/render/sidebar.rs
+++ b/src/librustdoc/html/render/sidebar.rs
@@ -599,7 +599,7 @@ fn sidebar_enum<'a>(
     deref_id_map: &'a DefIdMap<String>,
 ) {
     let mut variants = e
-        .variants()
+        .non_stripped_variants()
         .filter_map(|v| v.name)
         .map(|name| Link::new(format!("variant.{name}"), name.to_string()))
         .collect::<Vec<_>>();