speedy icon indicating copy to clipboard operation
speedy copied to clipboard

fix: return consistent results from readers

Open tjallingt opened this issue 1 year ago • 0 comments

fixes https://github.com/koute/speedy/issues/57

The test case is the same as from the issue. That doesn't cover "consistency" fully but at least its a regression for this case. More tests should be added to ensure that the same input produces a similar result (Ok/Err) across the different readers. I could write a macro for this if desired.

The fix is also a bit dubious. I'm not entirely sure what the output.len() < self.buffer.capacity() line is for. I removed it because I noticed that the issue was caused by the capacity set on the circular buffer. Expecting a vec with length of >= 8192 would fail but anything shorter would succeed.

tjallingt avatar Feb 14 '24 10:02 tjallingt