From e502603532fe2c76c8c584a71660df87bfa121c7 Mon Sep 17 00:00:00 2001 From: Patrick Barrett Date: Sat, 14 Jan 2017 12:59:22 -0600 Subject: use the 'Out' type in encode rather than copy/paste --- examples/udp-codec.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'examples/udp-codec.rs') 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), - into: &mut Vec) -> SocketAddr { + fn encode(&mut self, (addr, buf): Self::Out, into: &mut Vec) -> SocketAddr { into.extend(buf); return addr } -- cgit v1.2.3