From dcf8e895038a7677711b8168ee12e1d47f6018bc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Sep 2019 19:42:14 +0300 Subject: fix generated AST --- crates/ra_syntax/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/lib.rs') diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 2bced1867..edb6076bb 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -203,7 +203,8 @@ fn api_walkthrough() { assert_eq!(name.text(), "foo"); // Let's get the `1 + 1` expression! - let block: ast::Block = func.body().unwrap(); + let body: ast::BlockExpr = func.body().unwrap(); + let block = body.block().unwrap(); let expr: ast::Expr = block.expr().unwrap(); // Enums are used to group related ast nodes together, and can be used for -- cgit v1.2.3