mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -05:00
refactor(tokenizer): Remove stale function
This commit is contained in:
parent
ddeee94cf8
commit
1010d2ffe5
1 changed files with 2 additions and 6 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue