Merge pull request #145 from azdle/udp-codec-tweaks

UDP Codec Example Tweaks
This commit is contained in:
Alex Crichton
2017-01-15 10:17:57 -08:00
committed by GitHub
+2 -4
View File
@@ -28,11 +28,9 @@ 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
addr
}
}