Update send_dgram function signature. (#91)

* Update send_dgram function signature.

All other fns take `&SocketAddr`.

* Fix tests
This commit is contained in:
Carl Lerche
2018-01-30 14:49:55 -06:00
committed by Alex Crichton
parent 117dcba8cb
commit 0f4706d752
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -184,10 +184,10 @@ impl UdpSocket {
/// The `buf` parameter here only requires the `AsRef<[u8]>` trait, which
/// should be broadly applicable to accepting data which can be converted
/// to a slice.
pub fn send_dgram<T>(self, buf: T, addr: SocketAddr) -> SendDgram<T>
pub fn send_dgram<T>(self, buf: T, addr: &SocketAddr) -> SendDgram<T>
where T: AsRef<[u8]>,
{
SendDgram::new(self, buf, addr)
SendDgram::new(self, buf, *addr)
}
/// Receives data from the socket. On success, returns the number of bytes