Skip to content

Commit 6854f7d

Browse files
committed
Use sym::asterisk to avoid a Symbol::intern call.
1 parent ea34650 commit 6854f7d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/librustdoc/json/conversions.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::def::CtorKind;
1111
use rustc_hir::def_id::DefId;
1212
use rustc_metadata::rendered_const;
1313
use rustc_middle::{bug, ty};
14-
use rustc_span::{Pos, Symbol, kw};
14+
use rustc_span::{Pos, kw, sym};
1515
use rustdoc_json_types::*;
1616
use thin_vec::ThinVec;
1717

@@ -783,10 +783,7 @@ impl FromClean<clean::Import> for Use {
783783
use clean::ImportKind::*;
784784
let (name, is_glob) = match import.kind {
785785
Simple(s) => (s.to_string(), false),
786-
Glob => (
787-
import.source.path.last_opt().unwrap_or_else(|| Symbol::intern("*")).to_string(),
788-
true,
789-
),
786+
Glob => (import.source.path.last_opt().unwrap_or(sym::asterisk).to_string(), true),
790787
};
791788
Use {
792789
source: import.source.path.whole_name(),

0 commit comments

Comments
 (0)