Gain back 10MB/s on the json deserialization benchmark

This commit is contained in:
Erick Tryzelaar 2015-08-09 16:45:55 -07:00
parent 26873bf3d5
commit dc36fd38d6

View File

@ -54,8 +54,14 @@ impl<Iter> Deserializer<Iter>
match self.ch {
Some(ch) => Ok(Some(ch)),
None => {
self.ch = try!(self.next_char());
Ok(self.ch)
match self.rdr.next() {
Some(Err(err)) => Err(Error::IoError(err)),
Some(Ok(ch)) => {
self.ch = Some(ch);
Ok(self.ch)
}
None => Ok(None),
}
}
}
}