rust-base64 icon indicating copy to clipboard operation
rust-base64 copied to clipboard

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

Open mina86 opened this issue 2 years ago • 0 comments

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.

¹ https://github.com/rust-lang/rust/pull/107200

mina86 avatar Jan 20 '23 23:01 mina86