aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r--crates/ra_syntax/src/ast.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 56fb7c20c..81c709bfb 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -31,6 +31,12 @@ pub trait AstToken: AstNode {
31 } 31 }
32} 32}
33 33
34pub trait TypeAscriptionOwner: AstNode {
35 fn ascribed_type(&self) -> Option<&TypeRef> {
36 child_opt(self)
37 }
38}
39
34pub trait NameOwner: AstNode { 40pub trait NameOwner: AstNode {
35 fn name(&self) -> Option<&Name> { 41 fn name(&self) -> Option<&Name> {
36 child_opt(self) 42 child_opt(self)