Skip to content

Commit 4b2568e

Browse files
committed
clippy fix: rely on autoderef
1 parent c96a690 commit 4b2568e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/core/src/borrow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,20 @@ impl<T: ?Sized> BorrowMut<T> for T {
223223
#[stable(feature = "rust1", since = "1.0.0")]
224224
impl<T: ?Sized> Borrow<T> for &T {
225225
fn borrow(&self) -> &T {
226-
&**self
226+
self
227227
}
228228
}
229229

230230
#[stable(feature = "rust1", since = "1.0.0")]
231231
impl<T: ?Sized> Borrow<T> for &mut T {
232232
fn borrow(&self) -> &T {
233-
&**self
233+
self
234234
}
235235
}
236236

237237
#[stable(feature = "rust1", since = "1.0.0")]
238238
impl<T: ?Sized> BorrowMut<T> for &mut T {
239239
fn borrow_mut(&mut self) -> &mut T {
240-
&mut **self
240+
self
241241
}
242242
}

library/core/src/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ mod impls {
590590
#[inline(always)]
591591
#[rustc_diagnostic_item = "noop_method_clone"]
592592
fn clone(&self) -> Self {
593-
*self
593+
self
594594
}
595595
}
596596

0 commit comments

Comments
 (0)