mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
apply T! macro where it is possible
This commit is contained in:
parent
d77175ce28
commit
993abedd77
38 changed files with 619 additions and 623 deletions
|
@ -5,9 +5,10 @@ mod field_expr;
|
|||
|
||||
use crate::{
|
||||
SourceFile, SyntaxError, AstNode, SyntaxNode, TextUnit,
|
||||
SyntaxKind::{L_CURLY, R_CURLY, BYTE, BYTE_STRING, STRING, CHAR},
|
||||
SyntaxKind::{BYTE, BYTE_STRING, STRING, CHAR},
|
||||
ast,
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
T,
|
||||
};
|
||||
|
||||
pub(crate) use unescape::EscapeError;
|
||||
|
@ -83,8 +84,8 @@ pub(crate) fn validate_block_structure(root: &SyntaxNode) {
|
|||
let mut stack = Vec::new();
|
||||
for node in root.descendants() {
|
||||
match node.kind() {
|
||||
L_CURLY => stack.push(node),
|
||||
R_CURLY => {
|
||||
T!['{'] => stack.push(node),
|
||||
T!['}'] => {
|
||||
if let Some(pair) = stack.pop() {
|
||||
assert_eq!(
|
||||
node.parent(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue