An inherent method with the signature of Buf::to_bytes would not pass clippy:
methods called to_* usually take self by reference; consider choosing a less ambiguous name
help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
In the next breaking release, consider renaming the method or maybe replace it with #129 (though less deceptively named than copy_to_bytes).