io -- introduce local to avoid conflicting borrow

This commit is contained in:
Niko Matsakis 2014-02-07 14:51:44 -05:00
parent 42cd820c62
commit c9c8049cda
1 changed files with 2 additions and 1 deletions

View File

@ -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))
}
}