aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/validation.rs')
-rw-r--r--crates/ra_syntax/src/validation.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index f345dbd6e..a10b297c0 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -5,7 +5,7 @@ use arrayvec::ArrayString;
5use crate::{ 5use crate::{
6 algo::visit::{visitor_ctx, VisitorCtx}, 6 algo::visit::{visitor_ctx, VisitorCtx},
7 ast::{self, AstNode}, 7 ast::{self, AstNode},
8 File, 8 SourceFileNode,
9 string_lexing::{self, CharComponentKind}, 9 string_lexing::{self, CharComponentKind},
10 yellow::{ 10 yellow::{
11 SyntaxError, 11 SyntaxError,
@@ -13,7 +13,7 @@ use crate::{
13 }, 13 },
14}; 14};
15 15
16pub(crate) fn validate(file: &File) -> Vec<SyntaxError> { 16pub(crate) fn validate(file: &SourceFileNode) -> Vec<SyntaxError> {
17 let mut errors = Vec::new(); 17 let mut errors = Vec::new();
18 for node in file.syntax().descendants() { 18 for node in file.syntax().descendants() {
19 let _ = visitor_ctx(&mut errors) 19 let _ = visitor_ctx(&mut errors)
@@ -155,11 +155,11 @@ fn is_ascii_escape(code: char) -> bool {
155 155
156#[cfg(test)] 156#[cfg(test)]
157mod test { 157mod test {
158 use crate::File; 158 use crate::SourceFileNode;
159 159
160 fn build_file(literal: &str) -> File { 160 fn build_file(literal: &str) -> SourceFileNode {
161 let src = format!("const C: char = '{}';", literal); 161 let src = format!("const C: char = '{}';", literal);
162 File::parse(&src) 162 SourceFileNode::parse(&src)
163 } 163 }
164 164
165 fn assert_valid_char(literal: &str) { 165 fn assert_valid_char(literal: &str) {