Skip to content

Commit 2460f35

Browse files
committed
fix: Remove unnecessary Borrowed
Each implements a Copy trait
1 parent 468cb63 commit 2460f35

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/net/udp/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ impl UdpSocket {
391391
/// let mdns_addr = Ipv4Addr::new(224, 0, 0, 123);
392392
///
393393
/// let socket = UdpSocket::bind("127.0.0.1:0").await?;
394-
/// socket.join_multicast_v4(&mdns_addr, &interface)?;
394+
/// socket.join_multicast_v4(mdns_addr, interface)?;
395395
/// #
396396
/// # Ok(()) }) }
397397
/// ```
398-
pub fn join_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> {
398+
pub fn join_multicast_v4(&self, multiaddr: Ipv4Addr, interface: Ipv4Addr) -> io::Result<()> {
399399
self.watcher
400400
.get_ref()
401-
.join_multicast_v4(multiaddr, interface)
401+
.join_multicast_v4(&multiaddr, &interface)
402402
}
403403

404404
/// Executes an operation of the `IPV6_ADD_MEMBERSHIP` type.
@@ -435,10 +435,10 @@ impl UdpSocket {
435435
/// For more information about this option, see [`join_multicast_v4`].
436436
///
437437
/// [`join_multicast_v4`]: #method.join_multicast_v4
438-
pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> {
438+
pub fn leave_multicast_v4(&self, multiaddr: Ipv4Addr, interface: Ipv4Addr) -> io::Result<()> {
439439
self.watcher
440440
.get_ref()
441-
.leave_multicast_v4(multiaddr, interface)
441+
.leave_multicast_v4(&multiaddr, &interface)
442442
}
443443

444444
/// Executes an operation of the `IPV6_DROP_MEMBERSHIP` type.

src/task/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl TaskId {
122122
unsafe { TaskId(NonZeroU64::new_unchecked(id)) }
123123
}
124124

125-
pub(crate) fn as_u64(&self) -> u64 {
125+
pub(crate) fn as_u64(self) -> u64 {
126126
self.0.get()
127127
}
128128
}

0 commit comments

Comments
 (0)