Rename ModuleItem -> Item

This commit is contained in:
Aleksey Kladov 2020-07-30 00:23:03 +02:00
parent 16caadb404
commit 6636f56e79
17 changed files with 547 additions and 554 deletions

View file

@ -187,7 +187,7 @@ impl ast::Expr {
}
}
impl ast::ModuleItem {
impl ast::Item {
/// Returns `text`, parsed as an item, but only if it has no errors.
pub fn parse(text: &str) -> Result<Self, ()> {
parsing::parse_text_fragment(text, ra_parser::FragmentKind::Item)
@ -255,7 +255,7 @@ fn api_walkthrough() {
let mut func = None;
for item in file.items() {
match item {
ast::ModuleItem::FnDef(f) => func = Some(f),
ast::Item::FnDef(f) => func = Some(f),
_ => unreachable!(),
}
}