Skip to content

Commit

Permalink
implemented as_resulttextselection() for ResultItem<TextSelection>
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Dec 12, 2023
1 parent 5e71d29 commit 384d074
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/textselection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ impl<'store> FullHandle<TextSelection> for ResultItem<'store, TextSelection> {

/// This is the implementation of the high-level API for [`TextSelection`], though most of it is more commonly used via [`ResultTextSelection`].
impl<'store> ResultItem<'store, TextSelection> {
/// Returns the higher level structure
pub fn as_resulttextselection(self) -> ResultTextSelection<'store> {
ResultTextSelection::Bound(self)
}

/// Return the begin position (unicode points)
pub fn begin(&self) -> usize {
self.as_ref().begin()
Expand Down

0 comments on commit 384d074

Please sign in to comment.