mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Remove ast::Literal::token
This commit is contained in:
parent
7dfd1cb572
commit
2d5d16f18c
4 changed files with 19 additions and 11 deletions
|
@ -119,8 +119,15 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
|
|||
text.rfind(end_delimiter).and_then(|end| text.get(prefix_len..end))
|
||||
}
|
||||
|
||||
let token = literal.token();
|
||||
let text = token.text();
|
||||
let token = literal.value();
|
||||
let text;
|
||||
let text = match &token {
|
||||
rowan::NodeOrToken::Node(node) => {
|
||||
text = node.text().to_string();
|
||||
&*text
|
||||
}
|
||||
rowan::NodeOrToken::Token(token) => token.text(),
|
||||
};
|
||||
|
||||
// FIXME: lift this lambda refactor to `fn` (https://github.com/rust-analyzer/rust-analyzer/pull/2834#discussion_r366199205)
|
||||
let mut push_err = |prefix_len, (off, err): (usize, unescape::EscapeError)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue