about summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-03-25 12:50:47 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-03-25 22:11:14 +1100
commit6bea9c7a5465e27efbadced28322e6faf78bb174 (patch)
tree482c48c70c00000cec97f955dc25c9dcae7e8fd0 /src/librustdoc/clean/inline.rs
parentaa8f0fd7163a2f23aa958faed30c9c2b77b934a5 (diff)
downloadrust-6bea9c7a5465e27efbadced28322e6faf78bb174.tar.gz
rust-6bea9c7a5465e27efbadced28322e6faf78bb174.zip
rustdoc: remove useless `Symbol::is_empty` checks.
There are a number of `is_empty` checks that can never fail. This commit
removes them.
Diffstat (limited to 'src/librustdoc/clean/inline.rs')
-rw-r--r--src/librustdoc/clean/inline.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index e973b89b237..4fd669ab6d1 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -211,17 +211,7 @@ pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> &'hir [hir:
 }
 
 pub(crate) fn item_relative_path(tcx: TyCtxt<'_>, def_id: DefId) -> Vec<Symbol> {
-    tcx.def_path(def_id)
-        .data
-        .into_iter()
-        .filter_map(|elem| {
-            // extern blocks (and a few others things) have an empty name.
-            match elem.data.get_opt_name() {
-                Some(s) if !s.is_empty() => Some(s),
-                _ => None,
-            }
-        })
-        .collect()
+    tcx.def_path(def_id).data.into_iter().filter_map(|elem| elem.data.get_opt_name()).collect()
 }
 
 /// Record an external fully qualified name in the external_paths cache.