lifthrasiir/rust-encoding — pull request #2 by SimonSapin (2013-08-15 20:25:36+00:00)
Title: Add {De,En}coder.feed_into(), don’t return empty strings from .flush()

Insted of returning a string/sequence, .feed_into() appends to its "output" parameter. This avoids one copy when the resuts are accumulated in one string/sequnence.

Decoder.flush() and Encoder.flush() used to return strings, which were always empty. Just remove those.

(Any "good" output is already returned/written by .feed() / .feed_into())

.feed() methods are still around, if only so that I didn’t have to rewrite every test. They’re implemented as default methods on the traits, which are still experimental in Rust 0.7 and need a compiler flag to be accepted by the lint pass. They’re not experimental anymore in recent Rust.