Simplify Clone for ThinSlicePtr (#8247)
# Objective The type `ThinSlicePtr` has a manual implementation of `Clone` that manually clones each field. Since this type implements `Copy`, we can change this implementation to simply dereference `&self`.
This commit is contained in:
parent
dbb9e428cd
commit
f219a08907
@ -368,12 +368,7 @@ impl<'a, T> ThinSlicePtr<'a, T> {
|
|||||||
|
|
||||||
impl<'a, T> Clone for ThinSlicePtr<'a, T> {
|
impl<'a, T> Clone for ThinSlicePtr<'a, T> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Self {
|
*self
|
||||||
ptr: self.ptr,
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
len: self.len,
|
|
||||||
_marker: PhantomData,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user