Add an inline hint on Generator::next().
This improves the generate benchmark by about 1ns.
This commit is contained in:
parent
16c674b4f4
commit
15d2fbaf51
|
@ -167,6 +167,7 @@ impl<Item, Stack> Iterator for Generator<Item, Stack>
|
|||
|
||||
/// Resumes the generator and return the next value it yields.
|
||||
/// If the generator function has returned, returns `None`.
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
match self.state {
|
||||
State::Suspended => {
|
||||
|
|
Loading…
Reference in New Issue