Skip to content

Commit daed1b7

Browse files
rm unused SplitIter
1 parent e18a104 commit daed1b7

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

sudachi/src/dic/lexicon/word_infos.rs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021 Works Applications Co., Ltd.
2+
* Copyright (c) 2021-2024 Works Applications Co., Ltd.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,9 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
use std::iter::FusedIterator;
18-
19-
use crate::dic::lexicon_set::LexiconSet;
2017
use crate::dic::read::u32_parser;
2118
use crate::dic::read::word_info::WordInfoParser;
2219
use crate::dic::subset::InfoSubset;
@@ -177,30 +174,3 @@ impl From<WordInfo> for WordInfoData {
177174
info.data
178175
}
179176
}
180-
181-
struct SplitIter<'a> {
182-
index: usize,
183-
split: &'a [WordId],
184-
lexicon: &'a LexiconSet<'a>,
185-
}
186-
187-
impl Iterator for SplitIter<'_> {
188-
type Item = SudachiResult<WordInfo>;
189-
190-
fn next(&mut self) -> Option<Self::Item> {
191-
let idx = self.index;
192-
if idx >= self.split.len() {
193-
None
194-
} else {
195-
self.index += 1;
196-
Some(self.lexicon.get_word_info(self.split[idx]))
197-
}
198-
}
199-
200-
fn size_hint(&self) -> (usize, Option<usize>) {
201-
let rem = self.split.len() - self.index;
202-
(rem, Some(rem))
203-
}
204-
}
205-
206-
impl FusedIterator for SplitIter<'_> {}

0 commit comments

Comments
 (0)