mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-24 17:26:51 +00:00
fix: Remove unnecessary Borrowed
Each implements a Copy trait
This commit is contained in:
parent
468cb6348f
commit
2460f35768
2 changed files with 6 additions and 6 deletions
|
@ -391,14 +391,14 @@ impl UdpSocket {
|
||||||
/// let mdns_addr = Ipv4Addr::new(224, 0, 0, 123);
|
/// let mdns_addr = Ipv4Addr::new(224, 0, 0, 123);
|
||||||
///
|
///
|
||||||
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
||||||
/// socket.join_multicast_v4(&mdns_addr, &interface)?;
|
/// socket.join_multicast_v4(mdns_addr, interface)?;
|
||||||
/// #
|
/// #
|
||||||
/// # Ok(()) }) }
|
/// # Ok(()) }) }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn join_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> {
|
pub fn join_multicast_v4(&self, multiaddr: Ipv4Addr, interface: Ipv4Addr) -> io::Result<()> {
|
||||||
self.watcher
|
self.watcher
|
||||||
.get_ref()
|
.get_ref()
|
||||||
.join_multicast_v4(multiaddr, interface)
|
.join_multicast_v4(&multiaddr, &interface)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes an operation of the `IPV6_ADD_MEMBERSHIP` type.
|
/// Executes an operation of the `IPV6_ADD_MEMBERSHIP` type.
|
||||||
|
@ -435,10 +435,10 @@ impl UdpSocket {
|
||||||
/// For more information about this option, see [`join_multicast_v4`].
|
/// For more information about this option, see [`join_multicast_v4`].
|
||||||
///
|
///
|
||||||
/// [`join_multicast_v4`]: #method.join_multicast_v4
|
/// [`join_multicast_v4`]: #method.join_multicast_v4
|
||||||
pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> {
|
pub fn leave_multicast_v4(&self, multiaddr: Ipv4Addr, interface: Ipv4Addr) -> io::Result<()> {
|
||||||
self.watcher
|
self.watcher
|
||||||
.get_ref()
|
.get_ref()
|
||||||
.leave_multicast_v4(multiaddr, interface)
|
.leave_multicast_v4(&multiaddr, &interface)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes an operation of the `IPV6_DROP_MEMBERSHIP` type.
|
/// Executes an operation of the `IPV6_DROP_MEMBERSHIP` type.
|
||||||
|
|
|
@ -122,7 +122,7 @@ impl TaskId {
|
||||||
unsafe { TaskId(NonZeroU64::new_unchecked(id)) }
|
unsafe { TaskId(NonZeroU64::new_unchecked(id)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn as_u64(&self) -> u64 {
|
pub(crate) fn as_u64(self) -> u64 {
|
||||||
self.0.get()
|
self.0.get()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue