mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
minor: dead code
This commit is contained in:
parent
7f28b49759
commit
958f20ff84
2 changed files with 1 additions and 13 deletions
|
@ -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::{
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue