diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2025-01-12 20:19:20 -0800 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2025-01-12 20:34:13 -0800 |
| commit | 5ccd6c04e5b0e81c8a0fdd8c0e9363be49ef053d (patch) | |
| tree | 7fbf9bb38c12920aa283f586ad2fedb05eaabebc /src/librustdoc/clean/mod.rs | |
| parent | e2fcdb8d360acd561e2b6425e41009d9fff2d989 (diff) | |
| download | rust-5ccd6c04e5b0e81c8a0fdd8c0e9363be49ef053d.tar.gz rust-5ccd6c04e5b0e81c8a0fdd8c0e9363be49ef053d.zip | |
rustdoc: Extract `AttributesExt::lists` trait method as function
The two implementations were identical, so there's no need to use a trait method.
Diffstat (limited to 'src/librustdoc/clean/mod.rs')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a36927c47eb..ed0c566d53d 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -186,8 +186,7 @@ fn generate_item_with_correct_attrs( // For glob re-exports the item may or may not exist to be re-exported (potentially the cfgs // on the path up until the glob can be removed, and only cfgs on the globbed item itself // matter), for non-inlined re-exports see #85043. - let is_inline = inline::load_attrs(cx, import_id.to_def_id()) - .lists(sym::doc) + let is_inline = hir_attr_lists(inline::load_attrs(cx, import_id.to_def_id()), sym::doc) .get_word_attr(sym::inline) .is_some() || (is_glob_import(cx.tcx, import_id) @@ -979,13 +978,14 @@ fn clean_proc_macro<'tcx>( ) -> ItemKind { let attrs = cx.tcx.hir().attrs(item.hir_id()); if kind == MacroKind::Derive - && let Some(derive_name) = attrs.lists(sym::proc_macro_derive).find_map(|mi| mi.ident()) + && let Some(derive_name) = + hir_attr_lists(attrs, sym::proc_macro_derive).find_map(|mi| mi.ident()) { *name = derive_name.name; } let mut helpers = Vec::new(); - for mi in attrs.lists(sym::proc_macro_derive) { + for mi in hir_attr_lists(attrs, sym::proc_macro_derive) { if !mi.has_name(sym::attributes) { continue; } @@ -2985,7 +2985,7 @@ fn clean_use_statement_inner<'tcx>( let visibility = cx.tcx.visibility(import.owner_id); let attrs = cx.tcx.hir().attrs(import.hir_id()); - let inline_attr = attrs.lists(sym::doc).get_word_attr(sym::inline); + let inline_attr = hir_attr_lists(attrs, sym::doc).get_word_attr(sym::inline); let pub_underscore = visibility.is_public() && name == kw::Underscore; let current_mod = cx.tcx.parent_module_from_def_id(import.owner_id.def_id); let import_def_id = import.owner_id.def_id; |
