refactor(tokenizer): Remove stale function

This commit is contained in:
Ed Page 2021-02-11 14:30:26 -06:00
parent ddeee94cf8
commit 1010d2ffe5

View file

@ -181,7 +181,7 @@ impl<'t> Identifier<'t> {
/// Split into individual Words. /// Split into individual Words.
pub fn split(&self) -> impl Iterator<Item = Word<'t>> { pub fn split(&self) -> impl Iterator<Item = Word<'t>> {
split_ident(self.token, self.offset) SplitIdent::new(self.token, self.offset)
} }
} }
@ -195,7 +195,7 @@ pub struct Word<'t> {
impl<'t> Word<'t> { impl<'t> Word<'t> {
pub fn new(token: &'t str, offset: usize) -> Result<Self, std::io::Error> { pub fn new(token: &'t str, offset: usize) -> Result<Self, std::io::Error> {
let mut itr = split_ident(token, 0); let mut itr = SplitIdent::new(token, 0);
let mut item = itr.next().ok_or_else(|| { let mut item = itr.next().ok_or_else(|| {
std::io::Error::new( std::io::Error::new(
std::io::ErrorKind::InvalidInput, std::io::ErrorKind::InvalidInput,
@ -239,10 +239,6 @@ impl<'t> Word<'t> {
} }
} }
fn split_ident(ident: &str, offset: usize) -> impl Iterator<Item = Word<'_>> {
SplitIdent::new(ident, offset)
}
struct SplitIdent<'s> { struct SplitIdent<'s> {
ident: &'s str, ident: &'s str,
offset: usize, offset: usize,