diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-12 15:59:47 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-12 15:59:47 +0000 |
commit | 9aebd9e6caf49467ca20caf2583c47cf5092c788 (patch) | |
tree | 93c56d8301131a01de13b73010f615291eb1d6d4 /crates/ra_syntax/src/ast/mod.rs | |
parent | a4f7d7a7cd85a5b9b64a935dd84ad493b6860236 (diff) | |
parent | c96bfe7e2d4465653fe6b0eff053f0dfb48313fa (diff) |
Merge #226
226: Validate byte literals and byte strings r=aochagavia a=aochagavia
Co-authored-by: Adolfo OchagavĂa <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/mod.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/mod.rs b/crates/ra_syntax/src/ast/mod.rs index f20714ede..7077e3492 100644 --- a/crates/ra_syntax/src/ast/mod.rs +++ b/crates/ra_syntax/src/ast/mod.rs | |||
@@ -134,6 +134,18 @@ impl<'a> Char<'a> { | |||
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | impl<'a> Byte<'a> { | ||
138 | pub fn text(&self) -> &SmolStr { | ||
139 | &self.syntax().leaf_text().unwrap() | ||
140 | } | ||
141 | } | ||
142 | |||
143 | impl<'a> ByteString<'a> { | ||
144 | pub fn text(&self) -> &SmolStr { | ||
145 | &self.syntax().leaf_text().unwrap() | ||
146 | } | ||
147 | } | ||
148 | |||
137 | impl<'a> String<'a> { | 149 | impl<'a> String<'a> { |
138 | pub fn text(&self) -> &SmolStr { | 150 | pub fn text(&self) -> &SmolStr { |
139 | &self.syntax().leaf_text().unwrap() | 151 | &self.syntax().leaf_text().unwrap() |