mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
parent
b3ef934ccb
commit
25242fe93f
395 changed files with 14569 additions and 5755 deletions
|
@ -82,7 +82,7 @@ impl<N: AstNode> AstPtr<N> {
|
|||
|
||||
/// Like `SyntaxNodePtr::cast` but the trait bounds work out.
|
||||
pub fn try_from_raw(raw: SyntaxNodePtr) -> Option<AstPtr<N>> {
|
||||
N::can_cast(raw.kind()).then(|| AstPtr { raw, _ty: PhantomData })
|
||||
N::can_cast(raw.kind()).then_some(AstPtr { raw, _ty: PhantomData })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue