aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r--crates/ra_syntax/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index ac59455e7..219dd0b07 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -187,7 +187,7 @@ impl ast::Expr {
187 } 187 }
188} 188}
189 189
190impl ast::ModuleItem { 190impl ast::Item {
191 /// Returns `text`, parsed as an item, but only if it has no errors. 191 /// Returns `text`, parsed as an item, but only if it has no errors.
192 pub fn parse(text: &str) -> Result<Self, ()> { 192 pub fn parse(text: &str) -> Result<Self, ()> {
193 parsing::parse_text_fragment(text, ra_parser::FragmentKind::Item) 193 parsing::parse_text_fragment(text, ra_parser::FragmentKind::Item)
@@ -255,7 +255,7 @@ fn api_walkthrough() {
255 let mut func = None; 255 let mut func = None;
256 for item in file.items() { 256 for item in file.items() {
257 match item { 257 match item {
258 ast::ModuleItem::FnDef(f) => func = Some(f), 258 ast::Item::FnDef(f) => func = Some(f),
259 _ => unreachable!(), 259 _ => unreachable!(),
260 } 260 }
261 } 261 }