See the test in
oli-obk/cargo_metadata@ea84dc3
There, the for message in stream_deserilizer loop loops infinitelly, because serde repeteadly tries to parse the same invalid portion of input.
I think the correct behavior here is to "poison" the Iterator after the first error and return None. I can also imagine some error-recovey strategy (like skipping to the next utf8 codepoint), but poisoning seems more reliable to me.
See the test in
oli-obk/cargo_metadata@ea84dc3
There, the
for message in stream_deserilizerloop loops infinitelly, because serde repeteadly tries to parse the same invalid portion of input.I think the correct behavior here is to "poison" the Iterator after the first error and return
None. I can also imagine some error-recovey strategy (like skipping to the next utf8 codepoint), but poisoning seems more reliable to me.