diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-24 07:28:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-24 07:28:40 +0100 |
commit | 4c293c0a57fbe91587f6517403c30bb61ac21dc5 (patch) | |
tree | e7755c4113e079ae6558d2ad2b5e0718ea5c7284 /crates/ra_mbe/src | |
parent | c12a713739e30019497ab0f5e7bfa776122bfc6d (diff) | |
parent | 66101e931c641b7d96dcfdbb83838130eab588bc (diff) |
Merge #1902
1902: simplify r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src')
-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); |