aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/mod.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-11-12 15:59:47 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-11-12 15:59:47 +0000
commit9aebd9e6caf49467ca20caf2583c47cf5092c788 (patch)
tree93c56d8301131a01de13b73010f615291eb1d6d4 /crates/ra_syntax/src/ast/mod.rs
parenta4f7d7a7cd85a5b9b64a935dd84ad493b6860236 (diff)
parentc96bfe7e2d4465653fe6b0eff053f0dfb48313fa (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.rs12
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
137impl<'a> Byte<'a> {
138 pub fn text(&self) -> &SmolStr {
139 &self.syntax().leaf_text().unwrap()
140 }
141}
142
143impl<'a> ByteString<'a> {
144 pub fn text(&self) -> &SmolStr {
145 &self.syntax().leaf_text().unwrap()
146 }
147}
148
137impl<'a> String<'a> { 149impl<'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()