clippy: Enable non_canonical_clone_impl rule

This commit is contained in:
Tetsuharu Ohzeki 2024-02-09 22:37:42 +09:00
parent 7669619f9a
commit 2601d19bac
4 changed files with 4 additions and 5 deletions

View File

@ -172,7 +172,6 @@ borrowed_box = "allow"
derived_hash_with_manual_eq = "allow"
forget_non_drop = "allow"
needless_doctest_main = "allow"
non_canonical_clone_impl = "allow"
non_canonical_partial_ord_impl = "allow"
too_many_arguments = "allow"
type_complexity = "allow"

View File

@ -372,7 +372,7 @@ pub fn index(&self) -> Idx<N> {
impl<N> Clone for FileItemTreeId<N> {
fn clone(&self) -> Self {
Self(self.0)
*self
}
}
impl<N> Copy for FileItemTreeId<N> {}

View File

@ -219,7 +219,7 @@ pub struct ItemLoc<N: ItemTreeModItemNode> {
impl<N: ItemTreeModItemNode> Clone for ItemLoc<N> {
fn clone(&self) -> Self {
Self { container: self.container, id: self.id }
*self
}
}
@ -248,7 +248,7 @@ pub struct AssocItemLoc<N: ItemTreeModItemNode> {
impl<N: ItemTreeModItemNode> Clone for AssocItemLoc<N> {
fn clone(&self) -> Self {
Self { container: self.container, id: self.id }
*self
}
}

View File

@ -36,7 +36,7 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl<N: AstNode> Copy for AstPtr<N> {}
impl<N: AstNode> Clone for AstPtr<N> {
fn clone(&self) -> AstPtr<N> {
AstPtr { raw: self.raw, _ty: PhantomData }
*self
}
}