From 15d2fbaf5187c704ac428291cd2203805747f5da Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 17 Jul 2016 05:07:08 +0000 Subject: [PATCH] Add an inline hint on Generator::next(). This improves the generate benchmark by about 1ns. --- src/generator.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generator.rs b/src/generator.rs index c576be4..05d4fa3 100644 --- a/src/generator.rs +++ b/src/generator.rs @@ -167,6 +167,7 @@ impl Iterator for Generator /// Resumes the generator and return the next value it yields. /// If the generator function has returned, returns `None`. + #[inline] fn next(&mut self) -> Option { match self.state { State::Suspended => {