-
Notifications
You must be signed in to change notification settings - Fork 19
Add support for skip method / More population triggers
#144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| # filepath contents | ||
| if buffer.io.size == 0 | ||
| write(buffer.io, read(buffer.path)) | ||
| seekstart(buffer.io) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could definitely clean up Base.read(buffer::FileBuffer, ::Type{UInt8}) but we should probably leave the other _read(...); seekstart(...) calls alone as they would rewind the stream on each call after the FileBuffer was populated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think when I initially wrote this the automatic rewinding seemed helpful for my use case. In retrospect, it seems like it has caused more problems with the IO API. I'm a little surprised this didn't break any of the existing tests though.
Codecov Report
@@ Coverage Diff @@
## master #144 +/- ##
==========================================
+ Coverage 91.70% 91.77% +0.07%
==========================================
Files 12 12
Lines 1182 1180 -2
==========================================
- Hits 1084 1083 -1
+ Misses 98 97 -1
Continue to review full report at Codecov.
|
rofinn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. I think the existing tests covered my use, so if those aren't changing, then it should be fine. Please bump the patch release when you get a chance.
| # filepath contents | ||
| if buffer.io.size == 0 | ||
| write(buffer.io, read(buffer.path)) | ||
| seekstart(buffer.io) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think when I initially wrote this the automatic rewinding seemed helpful for my use case. In retrospect, it seems like it has caused more problems with the IO API. I'm a little surprised this didn't break any of the existing tests though.
Fixes #143. Also, made it so more methods trigger the
FileBufferto become populated to avoid erroneous behaviour.I ended up using the short-form function syntax with two statements which I normally avoid but here it seemed cleaner. More than willing to revise that.