Skip to content

Commit 2601d19

Browse files
clippy: Enable non_canonical_clone_impl rule
1 parent 7669619 commit 2601d19

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ borrowed_box = "allow"
172172
derived_hash_with_manual_eq = "allow"
173173
forget_non_drop = "allow"
174174
needless_doctest_main = "allow"
175-
non_canonical_clone_impl = "allow"
176175
non_canonical_partial_ord_impl = "allow"
177176
too_many_arguments = "allow"
178177
type_complexity = "allow"

crates/hir-def/src/item_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<N> FileItemTreeId<N> {
372372

373373
impl<N> Clone for FileItemTreeId<N> {
374374
fn clone(&self) -> Self {
375-
Self(self.0)
375+
*self
376376
}
377377
}
378378
impl<N> Copy for FileItemTreeId<N> {}

crates/hir-def/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ pub struct ItemLoc<N: ItemTreeModItemNode> {
219219

220220
impl<N: ItemTreeModItemNode> Clone for ItemLoc<N> {
221221
fn clone(&self) -> Self {
222-
Self { container: self.container, id: self.id }
222+
*self
223223
}
224224
}
225225

@@ -248,7 +248,7 @@ pub struct AssocItemLoc<N: ItemTreeModItemNode> {
248248

249249
impl<N: ItemTreeModItemNode> Clone for AssocItemLoc<N> {
250250
fn clone(&self) -> Self {
251-
Self { container: self.container, id: self.id }
251+
*self
252252
}
253253
}
254254

crates/syntax/src/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<N: AstNode + std::fmt::Debug> std::fmt::Debug for AstPtr<N> {
3636
impl<N: AstNode> Copy for AstPtr<N> {}
3737
impl<N: AstNode> Clone for AstPtr<N> {
3838
fn clone(&self) -> AstPtr<N> {
39-
AstPtr { raw: self.raw, _ty: PhantomData }
39+
*self
4040
}
4141
}
4242

0 commit comments

Comments
 (0)