Skip to content
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

EncoderWriter: no longer adhere to ‘at most one write’ #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Jan 20, 2023

The wording around Write::write method is changing with requirement
that it maps to ‘at most one write’ being removed¹. With that, change
EncoderWriter::write so that it flushes entire output buffer at the
beginning and then proceeds to process new input. This eliminates
returning Ok(0) which is effectively an error.

Also, change accounting for the occupied portion of the output buffer.
Rather than just having occupied length, track occupied range which
means moving data to front is no longer necessary.

¹ rust-lang/rust#107200

@mina86 mina86 changed the title Use [T]::copy_within in EncoderWriter i/o [T]::rotate_left EncoderWriter: no longer adhere to ‘at most one write’ Feb 1, 2023
The wording around Write::write method is changing with requirement
that it maps to ‘at most one write’ being removed¹.  With that, change
EncoderWriter::write so that it flushes entire output buffer at the
beginning and then proceeds to process new input.  This eliminates
returning Ok(0) which is effectively an error.

Also, change accounting for the occupied portion of the output buffer.
Rather than just having occupied length, track occupied range which
means moving data to front is no longer necessary.

¹ rust-lang/rust#107200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant