Require not start if nothing to bind

This commit is contained in:
Ivan Ukhov 2015-08-03 16:52:40 -04:00
parent 26626fdeeb
commit b2e735b627

View File

@ -26,8 +26,13 @@ impl<'l> Iterator<'l> {
/// Read the next row. /// Read the next row.
pub fn next(&mut self) -> Result<Option<&[Value]>> { pub fn next(&mut self) -> Result<Option<&[Value]>> {
match self.state { match self.state {
Some(State::Row) => {}, Some(State::Done) => return Ok(None),
_ => return Ok(None), None => {
try!(self.statement.reset());
self.state = Some(try!(self.statement.step()));
return self.next();
},
_ => {},
} }
let values = match self.values.take() { let values = match self.values.take() {
Some(mut values) => { Some(mut values) => {