mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
simplify
This commit is contained in:
parent
c12a713739
commit
66101e931c
4 changed files with 24 additions and 38 deletions
|
@ -148,15 +148,7 @@ fn convert_ident(ident: &tt::Ident) -> TtToken {
|
|||
}
|
||||
|
||||
fn convert_punct(p: tt::Punct) -> TtToken {
|
||||
let kind = match p.char {
|
||||
// lexer may produce compound tokens for these ones
|
||||
'.' => T![.],
|
||||
':' => T![:],
|
||||
'=' => T![=],
|
||||
'!' => T![!],
|
||||
'-' => T![-],
|
||||
c => SyntaxKind::from_char(c).unwrap(),
|
||||
};
|
||||
let kind = SyntaxKind::from_char(p.char).unwrap();
|
||||
let text = {
|
||||
let mut buf = [0u8; 4];
|
||||
let s: &str = p.char.encode_utf8(&mut buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue