diff options
author | Patrick Barrett <patrick@psbarrett.com> | 2017-01-14 12:59:22 -0600 |
---|---|---|
committer | Patrick Barrett <patrick@psbarrett.com> | 2017-01-14 12:59:22 -0600 |
commit | e502603532fe2c76c8c584a71660df87bfa121c7 (patch) | |
tree | 079eacc29d48c84dcafd097b0e87e5b39f6de704 /examples/udp-codec.rs | |
parent | d0833074d6c47970b69baf69702c92a497c93fc2 (diff) |
use the 'Out' type in encode rather than copy/paste
Diffstat (limited to 'examples/udp-codec.rs')
-rw-r--r-- | examples/udp-codec.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/udp-codec.rs b/examples/udp-codec.rs index d43160c8..840caa4a 100644 --- a/examples/udp-codec.rs +++ b/examples/udp-codec.rs @@ -28,9 +28,7 @@ impl UdpCodec for LineCodec { Ok((*addr, buf.to_vec())) } - fn encode(&mut self, - (addr, buf): (SocketAddr, Vec<u8>), - into: &mut Vec<u8>) -> SocketAddr { + fn encode(&mut self, (addr, buf): Self::Out, into: &mut Vec<u8>) -> SocketAddr { into.extend(buf); return addr } |