mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
clippy fix: rely on autoderef
This commit is contained in:
@@ -223,20 +223,20 @@ fn borrow_mut(&mut self) -> &mut T {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Borrow<T> for &T {
|
||||
fn borrow(&self) -> &T {
|
||||
&**self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Borrow<T> for &mut T {
|
||||
fn borrow(&self) -> &T {
|
||||
&**self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> BorrowMut<T> for &mut T {
|
||||
fn borrow_mut(&mut self) -> &mut T {
|
||||
&mut **self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +590,7 @@ impl<T: PointeeSized> Clone for &T {
|
||||
#[inline(always)]
|
||||
#[rustc_diagnostic_item = "noop_method_clone"]
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ impl<T: ?Sized> const Deref for &T {
|
||||
|
||||
#[rustc_diagnostic_item = "noop_method_deref"]
|
||||
fn deref(&self) -> &T {
|
||||
*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ impl<T: ?Sized> const Deref for &mut T {
|
||||
type Target = T;
|
||||
|
||||
fn deref(&self) -> &T {
|
||||
*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ pub trait DerefMut: ~const Deref + PointeeSized {
|
||||
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
|
||||
impl<T: ?Sized> const DerefMut for &mut T {
|
||||
fn deref_mut(&mut self) -> &mut T {
|
||||
*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user