net: rename the argument for send_to (#7146)

This commit is contained in:
Motoyuki Kimura 2025-02-08 20:35:05 +09:00 committed by GitHub
parent 8713d39228
commit eb1a2ee990
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1164,8 +1164,8 @@ impl UdpSocket {
/// Ok(())
/// }
/// ```
pub async fn send_to<A: ToSocketAddrs>(&self, buf: &[u8], target: A) -> io::Result<usize> {
let mut addrs = to_socket_addrs(target).await?;
pub async fn send_to<A: ToSocketAddrs>(&self, buf: &[u8], addr: A) -> io::Result<usize> {
let mut addrs = to_socket_addrs(addr).await?;
match addrs.next() {
Some(target) => self.send_to_addr(buf, target).await,