mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
simiplify
This commit is contained in:
parent
d52ee59a71
commit
773ad2edb3
2 changed files with 10 additions and 11 deletions
|
@ -5,16 +5,16 @@ mod field_expr;
|
|||
|
||||
use crate::{
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
ast, AstNode, SourceFile, SyntaxError,
|
||||
ast, SyntaxError,
|
||||
SyntaxKind::{BYTE, BYTE_STRING, CHAR, STRING},
|
||||
SyntaxNode, TextUnit, T,
|
||||
};
|
||||
|
||||
pub(crate) use unescape::EscapeError;
|
||||
|
||||
pub(crate) fn validate(file: &SourceFile) -> Vec<SyntaxError> {
|
||||
pub(crate) fn validate(root: &SyntaxNode) -> Vec<SyntaxError> {
|
||||
let mut errors = Vec::new();
|
||||
for node in file.syntax().descendants() {
|
||||
for node in root.descendants() {
|
||||
let _ = visitor_ctx(&mut errors)
|
||||
.visit::<ast::Literal, _>(validate_literal)
|
||||
.visit::<ast::Block, _>(block::validate_block_node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue