about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-12-12 20:41:04 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2021-12-18 14:55:20 +0300
commit958f20ff843fb14e79eb6f684fe3ed24f67e8c34 (patch)
tree88dc021017a57bf23c4e6273778bc9f5a3f32da8
parent7f28b49759de5629a39536be0f14a55423da3e43 (diff)
downloadrust-958f20ff843fb14e79eb6f684fe3ed24f67e8c34.tar.gz
rust-958f20ff843fb14e79eb6f684fe3ed24f67e8c34.zip
minor: dead code
-rw-r--r--crates/syntax/src/lib.rs2
-rw-r--r--crates/syntax/src/parsing/lexer.rs12
2 files changed, 1 insertions, 13 deletions
diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs
index ec281625a6f..07817bfc0da 100644
--- a/crates/syntax/src/lib.rs
+++ b/crates/syntax/src/lib.rs
@@ -48,7 +48,7 @@ use text_edit::Indel;
 
 pub use crate::{
     ast::{AstNode, AstToken},
-    parsing::lexer::{lex_single_syntax_kind, lex_single_valid_syntax_kind, tokenize, Token},
+    parsing::lexer::{lex_single_syntax_kind, tokenize, Token},
     ptr::{AstPtr, SyntaxNodePtr},
     syntax_error::SyntaxError,
     syntax_node::{
diff --git a/crates/syntax/src/parsing/lexer.rs b/crates/syntax/src/parsing/lexer.rs
index ae4844e486e..d94f5f067de 100644
--- a/crates/syntax/src/parsing/lexer.rs
+++ b/crates/syntax/src/parsing/lexer.rs
@@ -75,18 +75,6 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option<SyntaxEr
     Some((first_token.kind, err))
 }
 
-/// The same as `lex_single_syntax_kind()` but returns only `SyntaxKind` and
-/// returns `None` if any tokenization error occurred.
-///
-/// Beware that unescape errors are not checked at tokenization time.
-pub fn lex_single_valid_syntax_kind(text: &str) -> Option<SyntaxKind> {
-    let (single_token, err) = lex_single_syntax_kind(text)?;
-    if err.is_some() {
-        return None;
-    }
-    Some(single_token)
-}
-
 /// Returns `SyntaxKind` and `Option<SyntaxError>` of the first token
 /// encountered at the beginning of the string.
 ///