mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +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()))
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user