From 1010d2ffe522b0c8b9f1b26f2ae5ede429671a37 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 11 Feb 2021 14:30:26 -0600 Subject: [PATCH] refactor(tokenizer): Remove stale function --- crates/typos/src/tokens.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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,