diff options
author | Aleksey Kladov <[email protected]> | 2019-09-22 21:46:27 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-09-24 07:28:16 +0100 |
commit | 66101e931c641b7d96dcfdbb83838130eab588bc (patch) | |
tree | e7755c4113e079ae6558d2ad2b5e0718ea5c7284 /crates/ra_mbe | |
parent | c12a713739e30019497ab0f5e7bfa776122bfc6d (diff) |
simplify
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r-- | crates/ra_mbe/src/subtree_source.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/ra_mbe/src/subtree_source.rs b/crates/ra_mbe/src/subtree_source.rs index 9d6d0133f..cf7458905 100644 --- a/crates/ra_mbe/src/subtree_source.rs +++ b/crates/ra_mbe/src/subtree_source.rs | |||
@@ -148,15 +148,7 @@ fn convert_ident(ident: &tt::Ident) -> TtToken { | |||
148 | } | 148 | } |
149 | 149 | ||
150 | fn convert_punct(p: tt::Punct) -> TtToken { | 150 | fn convert_punct(p: tt::Punct) -> TtToken { |
151 | let kind = match p.char { | 151 | let kind = SyntaxKind::from_char(p.char).unwrap(); |
152 | // lexer may produce compound tokens for these ones | ||
153 | '.' => T![.], | ||
154 | ':' => T![:], | ||
155 | '=' => T![=], | ||
156 | '!' => T![!], | ||
157 | '-' => T![-], | ||
158 | c => SyntaxKind::from_char(c).unwrap(), | ||
159 | }; | ||
160 | let text = { | 152 | let text = { |
161 | let mut buf = [0u8; 4]; | 153 | let mut buf = [0u8; 4]; |
162 | let s: &str = p.char.encode_utf8(&mut buf); | 154 | let s: &str = p.char.encode_utf8(&mut buf); |