diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-06-17 14:35:26 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-06-22 07:36:57 +1000 |
| commit | 6854f7d89ae60c96ae487e98f6cae03418435614 (patch) | |
| tree | f91e9a040d61b69f9a06f6bad8fc61344ee27cb3 | |
| parent | ea34650916887b5075812d0f11c1d3209e7f94ab (diff) | |
| download | rust-6854f7d89ae60c96ae487e98f6cae03418435614.tar.gz rust-6854f7d89ae60c96ae487e98f6cae03418435614.zip | |
Use `sym::asterisk` to avoid a `Symbol::intern` call.
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index cb4c1f7fbc0..076d373887a 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -11,7 +11,7 @@ use rustc_hir::def::CtorKind; use rustc_hir::def_id::DefId; use rustc_metadata::rendered_const; use rustc_middle::{bug, ty}; -use rustc_span::{Pos, Symbol, kw}; +use rustc_span::{Pos, kw, sym}; use rustdoc_json_types::*; use thin_vec::ThinVec; @@ -783,10 +783,7 @@ impl FromClean<clean::Import> for Use { use clean::ImportKind::*; let (name, is_glob) = match import.kind { Simple(s) => (s.to_string(), false), - Glob => ( - import.source.path.last_opt().unwrap_or_else(|| Symbol::intern("*")).to_string(), - true, - ), + Glob => (import.source.path.last_opt().unwrap_or(sym::asterisk).to_string(), true), }; Use { source: import.source.path.whole_name(), |
