File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -527,14 +527,19 @@ pub(crate) trait MetaVisitor<'ast> {
527
527
528
528
fn visit_meta_word ( & mut self , _meta_item : & ' ast ast:: MetaItem ) { }
529
529
530
- fn visit_meta_name_value ( & mut self , _meta_item : & ' ast ast:: MetaItem , _lit : & ' ast ast:: Lit ) { }
530
+ fn visit_meta_name_value (
531
+ & mut self ,
532
+ _meta_item : & ' ast ast:: MetaItem ,
533
+ _lit : & ' ast ast:: MetaItemLit ,
534
+ ) {
535
+ }
531
536
532
537
fn visit_nested_meta_item ( & mut self , nm : & ' ast ast:: NestedMetaItem ) {
533
538
match nm {
534
539
ast:: NestedMetaItem :: MetaItem ( ref meta_item) => self . visit_meta_item ( meta_item) ,
535
- ast:: NestedMetaItem :: Literal ( ref lit) => self . visit_literal ( lit) ,
540
+ ast:: NestedMetaItem :: Literal ( ref lit) => self . visit_meta_item_lit ( lit) ,
536
541
}
537
542
}
538
543
539
- fn visit_literal ( & mut self , _lit : & ' ast ast:: Lit ) { }
544
+ fn visit_meta_item_lit ( & mut self , _lit : & ' ast ast:: MetaItemLit ) { }
540
545
}
Original file line number Diff line number Diff line change @@ -84,23 +84,27 @@ impl PathVisitor {
84
84
}
85
85
86
86
impl < ' ast > MetaVisitor < ' ast > for PathVisitor {
87
- fn visit_meta_name_value ( & mut self , meta_item : & ' ast ast:: MetaItem , lit : & ' ast ast:: Lit ) {
87
+ fn visit_meta_name_value (
88
+ & mut self ,
89
+ meta_item : & ' ast ast:: MetaItem ,
90
+ lit : & ' ast ast:: MetaItemLit ,
91
+ ) {
88
92
if meta_item. has_name ( Symbol :: intern ( "path" ) ) && lit. kind . is_str ( ) {
89
- self . paths . push ( lit_to_str ( lit) ) ;
93
+ self . paths . push ( meta_item_lit_to_str ( lit) ) ;
90
94
}
91
95
}
92
96
}
93
97
94
98
#[ cfg( not( windows) ) ]
95
- fn lit_to_str ( lit : & ast:: Lit ) -> String {
99
+ fn meta_item_lit_to_str ( lit : & ast:: MetaItemLit ) -> String {
96
100
match lit. kind {
97
101
ast:: LitKind :: Str ( symbol, ..) => symbol. to_string ( ) ,
98
102
_ => unreachable ! ( ) ,
99
103
}
100
104
}
101
105
102
106
#[ cfg( windows) ]
103
- fn lit_to_str ( lit : & ast:: Lit ) -> String {
107
+ fn meta_item_lit_to_str ( lit : & ast:: MetaItemLit ) -> String {
104
108
match lit. kind {
105
109
ast:: LitKind :: Str ( symbol, ..) => symbol. as_str ( ) . replace ( "/" , "\\ " ) ,
106
110
_ => unreachable ! ( ) ,
You can’t perform that action at this time.
0 commit comments