mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
io -- introduce local to avoid conflicting borrow
This commit is contained in:
parent
42cd820c62
commit
c9c8049cda
@ -83,7 +83,8 @@ impl Reader for UdpStream {
|
||||
|
||||
impl Writer for UdpStream {
|
||||
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
|
||||
self.as_socket(|sock| sock.sendto(buf, self.connectedTo))
|
||||
let connectedTo = self.connectedTo;
|
||||
self.as_socket(|sock| sock.sendto(buf, connectedTo))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user