File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,11 @@ impl<'a> Iterator for PinyinStrIter<'a> {
144144 fn next ( & mut self ) -> Option < Self :: Item > {
145145 self . 0 . next ( ) . map ( |c| c. to_pinyin ( ) )
146146 }
147+
148+ #[ inline]
149+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
150+ self . 0 . size_hint ( )
151+ }
147152}
148153
149154#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ impl Iterator for PinyinMultiIter {
6060 self . index += 1 ;
6161 } )
6262 }
63+
64+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
65+ let remaining = self . inner . count ( ) - self . index ;
66+ ( remaining, Some ( remaining) )
67+ }
6368}
6469
6570/// 用于获取多音字信息的 trait
@@ -134,6 +139,11 @@ impl<'a> Iterator for PinyinMultiStrIter<'a> {
134139 fn next ( & mut self ) -> Option < Self :: Item > {
135140 self . 0 . next ( ) . map ( |c| c. to_pinyin_multi ( ) )
136141 }
142+
143+ #[ inline]
144+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
145+ self . 0 . size_hint ( )
146+ }
137147}
138148
139149#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments