Skip to content

Commit cdff11c

Browse files
committed
Rename ast::Lit as ast::MetaItemLit.
1 parent 3d44530 commit cdff11c

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/attr.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,19 @@ pub(crate) trait MetaVisitor<'ast> {
527527

528528
fn visit_meta_word(&mut self, _meta_item: &'ast ast::MetaItem) {}
529529

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+
}
531536

532537
fn visit_nested_meta_item(&mut self, nm: &'ast ast::NestedMetaItem) {
533538
match nm {
534539
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),
536541
}
537542
}
538543

539-
fn visit_literal(&mut self, _lit: &'ast ast::Lit) {}
544+
fn visit_meta_item_lit(&mut self, _lit: &'ast ast::MetaItemLit) {}
540545
}

src/modules/visitor.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,27 @@ impl PathVisitor {
8484
}
8585

8686
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+
) {
8892
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));
9094
}
9195
}
9296
}
9397

9498
#[cfg(not(windows))]
95-
fn lit_to_str(lit: &ast::Lit) -> String {
99+
fn meta_item_lit_to_str(lit: &ast::MetaItemLit) -> String {
96100
match lit.kind {
97101
ast::LitKind::Str(symbol, ..) => symbol.to_string(),
98102
_ => unreachable!(),
99103
}
100104
}
101105

102106
#[cfg(windows)]
103-
fn lit_to_str(lit: &ast::Lit) -> String {
107+
fn meta_item_lit_to_str(lit: &ast::MetaItemLit) -> String {
104108
match lit.kind {
105109
ast::LitKind::Str(symbol, ..) => symbol.as_str().replace("/", "\\"),
106110
_ => unreachable!(),

0 commit comments

Comments
 (0)