@@ -50,7 +50,7 @@ use syntax::ast;
50
50
use syntax:: ext:: base:: MacroKind ;
51
51
use syntax:: source_map:: FileName ;
52
52
use syntax:: feature_gate:: UnstableFeatures ;
53
- use syntax:: symbol:: sym;
53
+ use syntax:: symbol:: { Symbol , sym} ;
54
54
use rustc:: hir:: def_id:: { CrateNum , CRATE_DEF_INDEX , DefId } ;
55
55
use rustc:: middle:: privacy:: AccessLevels ;
56
56
use rustc:: middle:: stability;
@@ -573,23 +573,23 @@ pub fn run(mut krate: clean::Crate,
573
573
// going to emit HTML
574
574
if let Some ( attrs) = krate. module . as_ref ( ) . map ( |m| & m. attrs ) {
575
575
for attr in attrs. lists ( sym:: doc) {
576
- match ( attr. name_or_empty ( ) . get ( ) , attr. value_str ( ) ) {
577
- ( " html_favicon_url" , Some ( s) ) => {
576
+ match ( attr. name_or_empty ( ) , attr. value_str ( ) ) {
577
+ ( sym :: html_favicon_url, Some ( s) ) => {
578
578
scx. layout . favicon = s. to_string ( ) ;
579
579
}
580
- ( " html_logo_url" , Some ( s) ) => {
580
+ ( sym :: html_logo_url, Some ( s) ) => {
581
581
scx. layout . logo = s. to_string ( ) ;
582
582
}
583
- ( " html_playground_url" , Some ( s) ) => {
583
+ ( sym :: html_playground_url, Some ( s) ) => {
584
584
markdown:: PLAYGROUND . with ( |slot| {
585
585
let name = krate. name . clone ( ) ;
586
586
* slot. borrow_mut ( ) = Some ( ( Some ( name) , s. to_string ( ) ) ) ;
587
587
} ) ;
588
588
}
589
- ( " issue_tracker_base_url" , Some ( s) ) => {
589
+ ( sym :: issue_tracker_base_url, Some ( s) ) => {
590
590
scx. issue_tracker_base_url = Some ( s. to_string ( ) ) ;
591
591
}
592
- ( " html_no_source" , None ) if attr. is_word ( ) => {
592
+ ( sym :: html_no_source, None ) if attr. is_word ( ) => {
593
593
scx. include_sources = false ;
594
594
}
595
595
_ => { }
@@ -3762,22 +3762,22 @@ fn render_attribute(attr: &ast::MetaItem) -> Option<String> {
3762
3762
}
3763
3763
}
3764
3764
3765
- const ATTRIBUTE_WHITELIST : & ' static [ & ' static str ] = & [
3766
- " export_name" ,
3767
- " lang" ,
3768
- " link_section" ,
3769
- " must_use" ,
3770
- " no_mangle" ,
3771
- " repr" ,
3772
- " unsafe_destructor_blind_to_params" ,
3773
- " non_exhaustive"
3765
+ const ATTRIBUTE_WHITELIST : & ' static [ Symbol ] = & [
3766
+ sym :: export_name,
3767
+ sym :: lang,
3768
+ sym :: link_section,
3769
+ sym :: must_use,
3770
+ sym :: no_mangle,
3771
+ sym :: repr,
3772
+ sym :: unsafe_destructor_blind_to_params,
3773
+ sym :: non_exhaustive
3774
3774
] ;
3775
3775
3776
3776
fn render_attributes ( w : & mut dyn fmt:: Write , it : & clean:: Item ) -> fmt:: Result {
3777
3777
let mut attrs = String :: new ( ) ;
3778
3778
3779
3779
for attr in & it. attrs . other_attrs {
3780
- if !ATTRIBUTE_WHITELIST . contains ( & attr. name_or_empty ( ) . get ( ) ) {
3780
+ if !ATTRIBUTE_WHITELIST . contains ( & attr. name_or_empty ( ) ) {
3781
3781
continue ;
3782
3782
}
3783
3783
if let Some ( s) = render_attribute ( & attr. meta ( ) . unwrap ( ) ) {
0 commit comments