Skip to content

Commit b315e9a

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

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
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

library/core/src/ops/deref.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<T: ?Sized> const Deref for &T {
158158

159159
#[rustc_diagnostic_item = "noop_method_deref"]
160160
fn deref(&self) -> &T {
161-
*self
161+
self
162162
}
163163
}
164164

@@ -171,7 +171,7 @@ impl<T: ?Sized> const Deref for &mut T {
171171
type Target = T;
172172

173173
fn deref(&self) -> &T {
174-
*self
174+
self
175175
}
176176
}
177177

@@ -280,7 +280,7 @@ pub trait DerefMut: ~const Deref + PointeeSized {
280280
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
281281
impl<T: ?Sized> const DerefMut for &mut T {
282282
fn deref_mut(&mut self) -> &mut T {
283-
*self
283+
self
284284
}
285285
}
286286

0 commit comments

Comments
 (0)