mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
chore: update bytes dependency to git master (#1796)
Tokio will track changes to bytes until 0.5 is released.
This commit is contained in:
@@ -47,7 +47,14 @@ impl<C: Decoder + Unpin> Stream for UdpFramed<C> {
|
||||
|
||||
let (_n, addr) = unsafe {
|
||||
// Read into the buffer without having to initialize the memory.
|
||||
let res = ready!(Pin::new(&mut pin.socket).poll_recv_from(cx, pin.rd.bytes_mut()));
|
||||
//
|
||||
// safety: we know tokio::net::UdpSocket never reads from the memory
|
||||
// during a recv
|
||||
let res = {
|
||||
let bytes = &mut *(pin.rd.bytes_mut() as *mut _ as *mut [u8]);
|
||||
ready!(Pin::new(&mut pin.socket).poll_recv_from(cx, bytes))
|
||||
};
|
||||
|
||||
let (n, addr) = res?;
|
||||
pin.rd.advance_mut(n);
|
||||
(n, addr)
|
||||
|
||||
Reference in New Issue
Block a user