Skip to content

Commit 457b473

Browse files
authored
Merge pull request #245 from sinkuu/clone
Remove redundant clone
2 parents df09cc6 + 591427e commit 457b473

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

chalk-solve/src/clauses/program_clauses.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@ impl ToProgramClauses for AssociatedTyValue {
151151
};
152152

153153
let normalize_goal = DomainGoal::Normalize(Normalize {
154-
projection: projection.clone(),
154+
projection,
155155
ty: self.value.value.ty.clone(),
156156
});
157157

158158
// Determine the normalization
159159
let normalization = Binders {
160-
binders: all_binders.clone(),
160+
binders: all_binders,
161161
value: ProgramClauseImplication {
162-
consequence: normalize_goal.clone(),
163-
conditions: conditions,
162+
consequence: normalize_goal,
163+
conditions,
164164
},
165165
}
166166
.cast();
@@ -577,7 +577,7 @@ impl ToProgramClauses for TraitDatum {
577577
}
578578
}
579579

580-
let condition = DomainGoal::FromEnv(FromEnv::Trait(trait_ref.clone()));
580+
let condition = DomainGoal::FromEnv(FromEnv::Trait(trait_ref));
581581

582582
clauses.extend(
583583
self.binders
@@ -730,7 +730,7 @@ impl ToProgramClauses for AssociatedTyDatum {
730730
Binders {
731731
binders: binders.clone(),
732732
value: ProgramClauseImplication {
733-
consequence: projection_eq.clone().cast(),
733+
consequence: projection_eq.cast(),
734734
conditions: vec![],
735735
},
736736
}
@@ -838,10 +838,7 @@ impl ToProgramClauses for AssociatedTyDatum {
838838
};
839839

840840
// `ProjectionEq(<T as Foo>::Assoc = U)`
841-
let projection_eq = ProjectionEq {
842-
projection: projection.clone(),
843-
ty,
844-
};
841+
let projection_eq = ProjectionEq { projection, ty };
845842

846843
// Projection equality rule from above.
847844
//
@@ -851,10 +848,10 @@ impl ToProgramClauses for AssociatedTyDatum {
851848
// }
852849
clauses.push(
853850
Binders {
854-
binders: binders.clone(),
851+
binders,
855852
value: ProgramClauseImplication {
856-
consequence: projection_eq.clone().cast(),
857-
conditions: vec![normalize.clone().cast()],
853+
consequence: projection_eq.cast(),
854+
conditions: vec![normalize.cast()],
858855
},
859856
}
860857
.cast(),

0 commit comments

Comments
 (0)