mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
use the 'Out' type in encode rather than copy/paste
This commit is contained in:
parent
d0833074d6
commit
e502603532
@ -28,9 +28,7 @@ impl UdpCodec for LineCodec {
|
|||||||
Ok((*addr, buf.to_vec()))
|
Ok((*addr, buf.to_vec()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn encode(&mut self,
|
fn encode(&mut self, (addr, buf): Self::Out, into: &mut Vec<u8>) -> SocketAddr {
|
||||||
(addr, buf): (SocketAddr, Vec<u8>),
|
|
||||||
into: &mut Vec<u8>) -> SocketAddr {
|
|
||||||
into.extend(buf);
|
into.extend(buf);
|
||||||
return addr
|
return addr
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user