diff options
Diffstat (limited to 'crates/ra_text_edit/src/text_utils.rs')
-rw-r--r-- | crates/ra_text_edit/src/text_utils.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_text_edit/src/text_utils.rs b/crates/ra_text_edit/src/text_utils.rs new file mode 100644 index 000000000..e3b4dc4fe --- /dev/null +++ b/crates/ra_text_edit/src/text_utils.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | use text_unit::{TextRange, TextUnit}; | ||
2 | |||
3 | pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool { | ||
4 | range.start() <= offset && offset <= range.end() | ||
5 | } | ||