mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-04 01:20:49 +00:00
Don't expose SyntaxNodePtr impl details
This commit is contained in:
parent
fc0a47a0c1
commit
cae2498513
4 changed files with 7 additions and 9 deletions
|
@ -34,12 +34,8 @@ impl SyntaxNodePtr {
|
|||
self.range
|
||||
}
|
||||
|
||||
pub fn kind(&self) -> SyntaxKind {
|
||||
self.kind
|
||||
}
|
||||
|
||||
pub fn cast<N: AstNode>(self) -> Option<AstPtr<N>> {
|
||||
if !N::can_cast(self.kind()) {
|
||||
if !N::can_cast(self.kind) {
|
||||
return None;
|
||||
}
|
||||
Some(AstPtr { raw: self, _ty: PhantomData })
|
||||
|
@ -88,7 +84,7 @@ impl<N: AstNode> AstPtr<N> {
|
|||
}
|
||||
|
||||
pub fn cast<U: AstNode>(self) -> Option<AstPtr<U>> {
|
||||
if !U::can_cast(self.raw.kind()) {
|
||||
if !U::can_cast(self.raw.kind) {
|
||||
return None;
|
||||
}
|
||||
Some(AstPtr { raw: self.raw, _ty: PhantomData })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue