From 58e01d875477234c132061e3072ac19f4dfb7a32 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Tue, 28 Jan 2020 07:18:35 +0200 Subject: ra_syntax: rename first_token() -> lex_first_token() --- crates/ra_syntax/src/parsing/lexer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index d1315e604..f889e6a1d 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs @@ -64,7 +64,7 @@ pub fn tokenize(text: &str) -> (Vec, Vec) { /// /// Beware that unescape errors are not checked at tokenization time. pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option)> { - first_token(text) + lex_first_token(text) .filter(|(token, _)| token.len.to_usize() == text.len()) .map(|(token, error)| (token.kind, error)) } @@ -74,7 +74,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option Option { - first_token(text) + lex_first_token(text) .filter(|(token, error)| !error.is_some() && token.len.to_usize() == text.len()) .map(|(token, _error)| token.kind) } @@ -87,7 +87,7 @@ pub fn lex_single_valid_syntax_kind(text: &str) -> Option { /// The token is malformed if the returned error is not `None`. /// /// Beware that unescape errors are not checked at tokenization time. -fn first_token(text: &str) -> Option<(Token, Option)> { +fn lex_first_token(text: &str) -> Option<(Token, Option)> { // non-empty string is a precondtion of `rustc_lexer::first_token()`. if text.is_empty() { return None; -- cgit v1.2.3