Skip to content

Commit c9c8049

Browse files
committed
io -- introduce local to avoid conflicting borrow
1 parent 42cd820 commit c9c8049

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/io/net/udp.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ impl Reader for UdpStream {
8383

8484
impl Writer for UdpStream {
8585
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
86-
self.as_socket(|sock| sock.sendto(buf, self.connectedTo))
86+
let connectedTo = self.connectedTo;
87+
self.as_socket(|sock| sock.sendto(buf, connectedTo))
8788
}
8889
}
8990

0 commit comments

Comments
 (0)