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:
JoJoJet 2023-03-30 06:22:09 -04:00 committed by GitHub
parent dbb9e428cd
commit f219a08907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,12 +368,7 @@ impl<'a, T> ThinSlicePtr<'a, T> {
impl<'a, T> Clone for ThinSlicePtr<'a, T> {
fn clone(&self) -> Self {
Self {
ptr: self.ptr,
#[cfg(debug_assertions)]
len: self.len,
_marker: PhantomData,
}
*self
}
}