rust-base64
rust-base64 copied to clipboard
EncoderWriter: no longer adhere to ‘at most one write’
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