[go: up one dir, main page]

SDK/Rust/Encoding/BinWriter : Add to_bytes method to BinWriter trait for convenient serialization

What

Adds a default to_bytes implementation to the BinWriter trait.

Why

Many types implementing BinWriter require serialization to raw bytes. Adding a reusable to_bytes method simplifies this process and eliminates boilerplate in consuming code.

How

  • Introduced a default to_bytes method to the BinWriter trait.
    • It internally calls bin_write on a new Vec<u8> and returns the result.
  • This change is backward-compatible and does not impact existing implementations.
Edited by Brahima Dibassi

Merge request reports

Loading