diff options
author | Aleksey Kladov <[email protected]> | 2019-07-19 16:22:00 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-07-19 16:22:00 +0100 |
commit | 5c594bcb48f01bdcf3068f72cefffda337a03533 (patch) | |
tree | bf584b2bf88a35ebe9e5c91392fecb23b4935c97 /crates/ra_syntax/src/ast.rs | |
parent | 8718a47088585bdb411f37d1b7cd1244d7528eaa (diff) |
cleanup casts
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index ceb603c50..4a38197f6 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -10,7 +10,7 @@ use std::marker::PhantomData; | |||
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken}, | 12 | syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken}, |
13 | SmolStr, | 13 | SmolStr, SyntaxKind, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | pub use self::{ | 16 | pub use self::{ |
@@ -26,6 +26,8 @@ pub use self::{ | |||
26 | /// the same representation: a pointer to the tree root and a pointer to the | 26 | /// the same representation: a pointer to the tree root and a pointer to the |
27 | /// node itself. | 27 | /// node itself. |
28 | pub trait AstNode: Clone { | 28 | pub trait AstNode: Clone { |
29 | fn can_cast(kind: SyntaxKind) -> bool; | ||
30 | |||
29 | fn cast(syntax: SyntaxNode) -> Option<Self> | 31 | fn cast(syntax: SyntaxNode) -> Option<Self> |
30 | where | 32 | where |
31 | Self: Sized; | 33 | Self: Sized; |