diff --git a/crates/typos/src/tokens.rs b/crates/typos/src/tokens.rs index 3f5aefc..4fc2681 100644 --- a/crates/typos/src/tokens.rs +++ b/crates/typos/src/tokens.rs @@ -181,7 +181,7 @@ impl<'t> Identifier<'t> { /// Split into individual Words. pub fn split(&self) -> impl Iterator> { - split_ident(self.token, self.offset) + SplitIdent::new(self.token, self.offset) } } @@ -195,7 +195,7 @@ pub struct Word<'t> { impl<'t> Word<'t> { pub fn new(token: &'t str, offset: usize) -> Result { - let mut itr = split_ident(token, 0); + let mut itr = SplitIdent::new(token, 0); let mut item = itr.next().ok_or_else(|| { std::io::Error::new( std::io::ErrorKind::InvalidInput, @@ -239,10 +239,6 @@ impl<'t> Word<'t> { } } -fn split_ident(ident: &str, offset: usize) -> impl Iterator> { - SplitIdent::new(ident, offset) -} - struct SplitIdent<'s> { ident: &'s str, offset: usize,