Skip to content

Commit 82c3fe7

Browse files
bors[bot]Pascal Hertleif
andcommitted
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 <pascal@technocreatives.com>
2 parents 61135d4 + 6e87065 commit 82c3fe7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/ra_syntax/src/syntax_text.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ impl<'a> SyntaxText<'a> {
3838
}
3939

4040
pub fn to_smol_string(&self) -> SmolStr {
41-
// FIXME: use `self.chunks().collect()` here too once
42-
// https://github.com/matklad/smol_str/pull/12 is merged and published
43-
self.to_string().into()
41+
self.chunks().collect()
4442
}
4543

4644
pub fn contains(&self, c: char) -> bool {
@@ -63,6 +61,10 @@ impl<'a> SyntaxText<'a> {
6361
self.range.len()
6462
}
6563

64+
pub fn is_empty(&self) -> bool {
65+
self.range.is_empty()
66+
}
67+
6668
/// NB, the offsets here are absolute, and this probably doesn't make sense!
6769
pub fn slice(&self, range: impl ops::RangeBounds<TextUnit>) -> SyntaxText<'a> {
6870
let start = match range.start_bound() {

0 commit comments

Comments
 (0)