Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid running into infinite loops when recovering from Reader errors
Resolves BurntSushi#207 When reading and parsing a record fails, it's correct behaviour in most cases to keep on trying to read and parse the next record. However when the Error is caused by failing to read from the underlying `impl Read`, the next read would almost always fail with the exact same error. In that scenario, reading from the underlying `impl Read` should not be attempted when trying to deserialize the next record, as this may lead to infinite loops. Instead, the `Reader` will behave in the same way as if an end-of-file had been reached.
- Loading branch information