Closed imlk0 closed 1 year ago
This comment add a function TunPacket::into_bytes() to struct TunPacket, which allows users to consume TunPacket and return the inner Bytes instences.
TunPacket
Bytes
Thus we can avoid copy in the following code:
let bytes = Bytes::from(packet.get_bytes().to_owned())
@meh Hello meh, this PR is ready for review now.
This comment add a function TunPacket::into_bytes() to struct TunPacket, which allows users to consume
TunPacket
and return the innerBytes
instences.Thus we can avoid copy in the following code: