diff options
author | Aleksey Kladov <[email protected]> | 2018-11-06 19:06:58 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-06 19:06:58 +0000 |
commit | 7f88fe8790014f4c879ec49de4bfdb823043e16a (patch) | |
tree | fd67f18d5a631a1cbcb84cbe3455713943253fb8 /crates/ra_syntax/src/ast/mod.rs | |
parent | a5301e94d5467db8e48ed31c4abd562c79edb841 (diff) |
Add a pinch of comments
Diffstat (limited to 'crates/ra_syntax/src/ast/mod.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/mod.rs b/crates/ra_syntax/src/ast/mod.rs index 4355531d0..d93f92672 100644 --- a/crates/ra_syntax/src/ast/mod.rs +++ b/crates/ra_syntax/src/ast/mod.rs | |||
@@ -12,6 +12,10 @@ use crate::{ | |||
12 | SyntaxNodeRef, | 12 | SyntaxNodeRef, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | /// The main trait to go from untyped `SyntaxNode` to a typed ast. The | ||
16 | /// conversion itself has zero runtime cost: ast and syntax nodes have exactly | ||
17 | /// the same representation: a pointer to the tree root and a pointer to the | ||
18 | /// node itself. | ||
15 | pub trait AstNode<'a>: Clone + Copy + 'a { | 19 | pub trait AstNode<'a>: Clone + Copy + 'a { |
16 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> | 20 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> |
17 | where | 21 | where |