aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-10 17:59:44 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-10 17:59:44 +0100
commit82c3fe7d13b67bdec67b53e9adb6f3ec404bf5f0 (patch)
tree46788abb5483958dc0cac36e32c21a0c55086833 /crates/ra_syntax
parent61135d4d4df0a16cbd39831e23b7b0deeeea44a9 (diff)
parent6e870659684c9c2827eb9b9d62860a993f738953 (diff)
Merge #1518
1518: Remove a fixme r=matklad a=killercup Just saw the new release of SmolStr and was reminded of this FIXME I added :) Co-authored-by: Pascal Hertleif <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/syntax_text.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/syntax_text.rs b/crates/ra_syntax/src/syntax_text.rs
index e648dc082..939f2c02f 100644
--- a/crates/ra_syntax/src/syntax_text.rs
+++ b/crates/ra_syntax/src/syntax_text.rs
@@ -38,9 +38,7 @@ impl<'a> SyntaxText<'a> {
38 } 38 }
39 39
40 pub fn to_smol_string(&self) -> SmolStr { 40 pub fn to_smol_string(&self) -> SmolStr {
41 // FIXME: use `self.chunks().collect()` here too once 41 self.chunks().collect()
42 // https://github.com/matklad/smol_str/pull/12 is merged and published
43 self.to_string().into()
44 } 42 }
45 43
46 pub fn contains(&self, c: char) -> bool { 44 pub fn contains(&self, c: char) -> bool {
@@ -63,6 +61,10 @@ impl<'a> SyntaxText<'a> {
63 self.range.len() 61 self.range.len()
64 } 62 }
65 63
64 pub fn is_empty(&self) -> bool {
65 self.range.is_empty()
66 }
67
66 /// NB, the offsets here are absolute, and this probably doesn't make sense! 68 /// NB, the offsets here are absolute, and this probably doesn't make sense!
67 pub fn slice(&self, range: impl ops::RangeBounds<TextUnit>) -> SyntaxText<'a> { 69 pub fn slice(&self, range: impl ops::RangeBounds<TextUnit>) -> SyntaxText<'a> {
68 let start = match range.start_bound() { 70 let start = match range.start_bound() {