summaryrefslogtreecommitdiffstats
path: root/examples/udp-codec.rs
diff options
context:
space:
mode:
authorPatrick Barrett <patrick@psbarrett.com>2017-01-14 12:59:22 -0600
committerPatrick Barrett <patrick@psbarrett.com>2017-01-14 12:59:22 -0600
commite502603532fe2c76c8c584a71660df87bfa121c7 (patch)
tree079eacc29d48c84dcafd097b0e87e5b39f6de704 /examples/udp-codec.rs
parentd0833074d6c47970b69baf69702c92a497c93fc2 (diff)
use the 'Out' type in encode rather than copy/paste
Diffstat (limited to 'examples/udp-codec.rs')
-rw-r--r--examples/udp-codec.rs4
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
}